Versioning model instances
-
Chris Wanstrath
- State changed from new to open
Would the version be an attribute of the model or something? Could you post some pseudo-code, I'm not sure how this would work -- especially if the key depends on a row in the DB.
-
Chris Wanstrath
I should note that this kind of stuff can be done pretty easily by overriding self.cache_key, too. I talk about it a bit in my cache_fu slides -- http://errtheblog.com/post/4872
-
Lourens Naude
Scrap the above.
As per Michael Koziarski's suggestion, there might be a sweeter way to do this with Etag headers and the Nginx Memcached module.
1) Changeset 7580 allows you to specify a custom Etag header - a md5 hashed unique cache key for the request perhaps?
http://dev.rubyonrails.org/ticke...
2)The $memcached_key var in Nginx can possibly be assigned the value of the incoming Etag header
http://wiki.codemongers.com/Ngin...
3) The biatch is not hitting stale cache keys as Nginx wouldn't bother the backend.
MemCache#cache_incr can perhaps be used for versioning Etag cache keys in some way or another
I do realize this is not cache_fu specific so please do ignore if not appropriate / applicable.
-
Chris Wanstrath
- State changed from open to invalid
This seems out of the scope of cache_fu, but if you can somehow get some code or a capistrano task out of it, then by all means.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.