1

我最近将我的 Rails 应用程序升级到 5.2,但不知道为什么我的缓存不再过期。我将问题缩小到允许可回收缓存键的缓存键更改。

这是我的配置:

config.load_defaults 5.2
config.cache_store = :dalli_store

看法:

<% cache product do %>
  ...
<% end %>
4

1 回答 1

2

我发现了这个问题并想分享它以防其他人陷入困境!问题出在config.cache_store = :dalli_store. dalli_store不支持可回收的缓存键,所以你必须将其更改为 mem_cache_store:

config.cache_store = :mem_cache_store

我希望这可以帮助别人!

于 2018-01-08T22:16:26.847 回答