Skip to content

Containers support#16

Open
ylarom wants to merge 3 commits into
ahawkins:masterfrom
ylarom:master
Open

Containers support#16
ylarom wants to merge 3 commits into
ahawkins:masterfrom
ylarom:master

Conversation

@ylarom
Copy link
Copy Markdown

@ylarom ylarom commented Jan 31, 2013

  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.

@ahawkins
Copy link
Copy Markdown
Owner

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

@ftbl
Copy link
Copy Markdown

ftbl commented Feb 26, 2013

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.

@brain-geek
Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants