caching - Invalidate a specific model in the Rails cache -
I'm using Rail 3 with Memcached to cache some models. When the model changes, I want to invalidate the cache for that record. With pieces of the scene, I just say You did not mention that the model has actually been added to the cache. You can invalidate the model cache using the expire_fragment ("blah") . How can I do this with my model? I do not want to say
rings.cache.clear and I lose everything. I need something like
rails.cache.invalidate ("/ users / 5") . How do i do this
after_save hook.
class models & lt; After AR: Base: Sacrifice invalid invalid services Private invalid rails.cache.delete ("/ user / # {self.id}") End and
Comments
Post a Comment