如何确定 CherryPy 是否正在缓存响应?
CherryPy 在其默认配置中是否可能缓存对我的一个或多个请求处理程序的响应?如果是这样,我该如何关闭它?
Is it possible that CherryPy, in its default configuration, is caching the responses to one or more of my request handlers? And, if so, how do I turn that off?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据文档,确实有一个缓存(对于
GET
),您可以通过在配置中禁用它Per the docs, there is indeed a cache (for
GET
), and you can disable it by having in your configurationCherryPy 有一个缓存工具,但默认情况下它不会打开。不过,大多数 HTTP 响应默认情况下都是可缓存的,因此请在客户端和服务器之间寻找中间缓存。先看浏览器。
如果您不确定您的内容是否被缓存,请将日期响应标头与当前时间进行比较。
CherryPy has a caching Tool, but it's never on by default. Most HTTP responses are cacheable by default, though, so look for an intermediate cache between your client and server. Look at the browser first.
If you're not sure whether or not your content is being cached, compare the Date response header to the current time.