如何在不重新启动服务器的情况下清除coldfusion查询缓存?

发布于 2024-12-20 23:11:34 字数 338 浏览 6 评论 0原文

我有几个使用 cfquery 标记的 cachedwithin="#CreateTimespan(...)#" 属性缓存的查询。有时我需要清除缓存(或者只是重新执行查询以获取新的缓存副本)。从历史上看,我已经做了两件事之一来完成此任务 -

  1. 重新启动 Coldfusion 服务。
  2. 稍微改变代码中的查询,例如添加或删除空格。

这些选项都不是很好,尤其是在生产中。我不是问如何以编程方式使缓存过期(尽管,这会很好!),但更简单的是 - 如何清除服务器上的缓存查询,而不必诉诸上述两种方法之一?我很高兴听到有关在服务器范围或应用程序范围内工作的方法,甚至如何使特定的缓存查询过期的方法。谢谢!

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 -

  1. Restart the coldfusion service.
  2. 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

┼── 2024-12-27 23:11:34

您可以使用以下内容:

<cfobjectcache 
    action = "clear" />

有关完整的内容,请参阅 cfdocs解释。

You can use the following:

<cfobjectcache 
    action = "clear" />

See cfdocs for a full explanation.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文