Beaker@beaker_cache 缓存在 Pylons 中的位置

发布于 2024-10-09 19:21:15 字数 241 浏览 10 评论 0原文

我已经在 pylons-discuss 上问过这个问题,但没有得到答案。

我找不到 @beaker_cache 装饰器的缓存存储在哪里。我认为它应该在数据目录中,但事实并非如此。它也不在/tmp 中。我尝试设置 beaker.cache.data_dir = %(here)s/data/cache 并手动创建目录,但它仍然不存在(目录始终为空)。

不过,缓存是有效的。如果我第二次刷新页面,我看不到任何数据库查询。那么它存储在哪里呢?

I've already asked this on pylons-discuss but got no answers.

I can't find where the cache of the @beaker_cache decorator is stored. I thought it should be in the data directory but it's not. It's also not in /tmp. I tried setting beaker.cache.data_dir = %(here)s/data/cache and creating the directory manually but it's still not there (the dir is always empty).

However, the cache works. If I refresh the page the second time I see no database queries. Where is it stored then?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

陌路终见情 2024-10-16 19:21:15

根据您使用装饰器的方式,它可能会将数据存储在内存中。

@cache.cache('mycache', type="file", expire=15)
def my_action(self):
  stuff

type 可以是“文件”、“内存”或“数据库”。默认是内存。

Depending on how you are using the decorator, it could be storing the data in memory.

@cache.cache('mycache', type="file", expire=15)
def my_action(self):
  stuff

type can be 'file', 'memory', or 'database'. The default is memory.

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