cashier icon indicating copy to clipboard operation
cashier copied to clipboard

Containers support

Open ylarom opened this issue 12 years ago • 3 comments

  1. Support ActiveRecord as tag ("#{obj.class.name}-#{obj.to_param}")
  2. Detect dependencies of fragments containing other fragments, e.g., several article fragments displayed in a section fragment, and when the inner fragment is expired also expire its containers. In the example, today changing one of the articles' title won't be reflected in the section, since it's cached. The feature allows tagging the article fragment with the article object, then on_save call Cashier.expire(self), which will also expire the section.

ylarom avatar Jan 31 '13 15:01 ylarom

How is this better than Rails 4's support for russian doll caching?

ahawkins avatar Feb 26 '13 15:02 ahawkins

Russian doll mainly handles changes to the view file.

Let's say we have models section and article. The section view contains multiple article partials, and the section view is cached in full.

If a change is made to an article, the partial will expire, but not the full section view - it will still show the old version of the article. In order for the section view to expire, every change to an article should "touch" all the sections it's displayed on, which could be a costly operation, not to mention it's not a true business need - we'll be doing it only for view purposes.

ftbl avatar Feb 26 '13 16:02 ftbl

This concept is very similar to that I have implemented in https://github.com/brain-geek/activerecord_cashier - though activerecord_cashier also has mechanism to automaticaly trigger cache expiration on model save.

And it is also based on cashier - but in complementary way.

brain-geek avatar Jul 03 '14 12:07 brain-geek