i want to cache my model objects in low level ( aka low level caching ) and I am doing this by memcached
and dalli
. i overloaded the find method in FOO class :
def self.find(id)
Rails.cache.fetch('users/' , id) do
User.find(id)
end
end
the only problem here is about user updates. i want to expire that cache whenever the user is updated but i didn't find something like Rails.cache.expire(key)
. is there any suitable to do this?