主题:  关闭浏览器清空查询缓存

雅痞公子

职务:普通成员
等级:3
金币:-3.0
发贴:732
注册:2003/3/27 23:16:34
#12003/12/19 22:58:38
在一页中加入<cfobjectcache action="clear">,
是不是就能清除当前Application的所有查询缓存?



s22

职务:版主
等级:4
金币:10.0
发贴:1634
注册:2004/12/19 13:06:46
#22003/12/19 23:33:11
It flushes all cached queries on the server.

Dave Watts, CTO, Fig Leaf Software

That's odd. I remember you mentioning this before. I just built a very
simple test case, consisting of two separate pages, one containing a CFQUERY
with CACHEDWITHIN and the other containing CFOBJECTCACHE. I then turned on
debugging, and ran the query page twice (the second time to cache the
query), then ran the second page, then reran the query page, and the query
was no longer cached. I did this under CF 5 and CFMX. It worked under both.

Dave Watts, CTO, Fig Leaf Software

嘿嘿,figleaf的cto回答了你的问题



s22

职务:版主
等级:4
金币:10.0
发贴:1634
注册:2004/12/19 13:06:46
#32003/12/19 23:40:09
还可以用这个
<cfcomponent>
<cffunction name="clearCache" access="public" returntype="boolean">
<cftry>
<cfobjectcache action="clear" />
<cflock name="serviceFactory" type="exclusive" timeout="10">
<cfscript>
factory = CreateObject("java", "coldfusion.server.ServiceFactory";
datasource_service = factory.datasourceservice;
datasource_service.purgeQueryCache();
factory = '';
</cfscript>
</cflock>
<cfcatch>
<cfreturn false />
</cfcatch>
</cftry>
<cfreturn true />
</cffunction>
</cfcomponent>

www.flash-remoting.com/notablog/home.cfm?newsid=70



s22

职务:版主
等级:4
金币:10.0
发贴:1634
注册:2004/12/19 13:06:46
#42003/12/19 23:42:36
s22在上个帖子中说
引用:
It flushes all cached queries on the server.

Dave Watts, CTO, Fig Leaf Software

That's odd. I remember you mentioning this before. I just built a very
simple test case, consisting of two separate pages, one containing a CFQUERY
with CACHEDWITHIN and the other containing CFOBJECTCACHE. I then turned on
debugging, and ran the query page twice (the second time to cache the
query), then ran the second page, then reran the query page, and the query
was no longer cached. I did this under CF 5 and CFMX. It worked under both.

Dave Watts, CTO, Fig Leaf Software

嘿嘿,figleaf的cto回答了你的问题


帮助里是说是application scope,dave说是all cached on the server测试一下就知道啦



雅痞公子

职务:普通成员
等级:3
金币:-3.0
发贴:732
注册:2003/3/27 23:16:34
#52003/12/23 0:55:27
谢谢你的提示,我做了测试,dave说的对! ;)