我有一個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