I'm trying to setup cache expiration time like this:
Rails.cache.write('trash', items, expires_in: 30.seconds)
or like this
Rails.cache.read('trash', expires_in: 30.seconds)
but nothing works in my case. The cache is not deleted/invalidated after the expiration time passes.
Low-level caching, which you are trying to do here, doesn't work with Memstore (yellow box), the default for development. You'll have to setup something like MemCached or Redis for development.
2.1m questions
2.1m answers
60 comments
57.0k users