如何在不重新启动服务器的情况下清除coldfusion查询缓存?
我有几个使用 cfquery 标记的 cachedwithin="#CreateTimespan(...)#" 属性缓存的查询。有时我需要清除缓存(或者只是重新执行查询以获取新的缓存副本)。从历史上看,我已经做了两件事之一来完成此任务 -
- 重新启动 Coldfusion 服务。
- 稍微改变代码中的查询,例如添加或删除空格。
这些选项都不是很好,尤其是在生产中。我不是问如何以编程方式使缓存过期(尽管,这会很好!),但更简单的是 - 如何清除服务器上的缓存查询,而不必诉诸上述两种方法之一?我很高兴听到有关在服务器范围或应用程序范围内工作的方法,甚至如何使特定的缓存查询过期的方法。谢谢!
I have several queries that I cache using the cachedwithin="#CreateTimespan(...)#" attribute of the cfquery tag. There are times when I need to clear the cache (or just re-execute the query to get a new cached copy). Historically, I've done one of two things to accomplish this -
- Restart the coldfusion service.
- Slightly alter the query in the code, say by adding or deleting whitespace.
Neither of these options are very good, especially when in production. I'm not asking for how I might expire the cache programmatically (although, that would be nice!), but more simply - how can I clear the cached queries on the server without having to resort to one of those two above methods? I'd be happy to hear about methods that work either server-wide, or application-wide, or even how to expire a specific cached query. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用以下内容:
有关完整的内容,请参阅 cfdocs解释。
You can use the following:
See cfdocs for a full explanation.