我有一个rails应用程序,因为我使用简单的rails缓存。我的测试如下:Rails缓存过期
Rails.cache.write('temp',Date.today,:expires_in => 60.seconds)
我可以通过Rails.cache.read('temp')
和Rails.cache.fetch('temp')
阅读。
问题是它没有过期。 60秒后它仍然活着。任何人都可以告诉我这里缺少什么。
FYI:我在development.rb已经声明如下:
config.action_controller.perform_caching = true
config.cache_store = :memory_store
有什么我错过了?我想过期缓存。
感谢您的重播....让我试试,让你知道 – palani 2012-01-13 06:59:41
是mliebelt权,也是一个很好的轨道缓存文档,你可以在这里找到http://guides.rubyonrails.org/caching_with_rails.html – 2012-01-13 07:23:46