How to update expiration time in MemCached using Dalli?
问题 I'm using Ruby on Rails (v3.2.13), Dalli (v2.6.4) and MemCached (v1.4.13). I do caching like this: result = Rails.cache.fetch("test_key", :expires_in => 1.week) do get_data() # slow call, result of which should be cached end I want to update cache expiration date based on the data, since some of my data can be kept longer. Right now the following code does the job: if keep_longer(result) Rails.cache.write("test_key", result, :expires_in => 6.months) end I know that MemCached supports "touch"