Rails action_cache plugin update
The action_cache plugin has just been updated. I’ve added the Cache-Control: max-age=x header, where x is the number of seconds set in the time_to_live parameter on the response object.
This setting will encourage the browser to cache the response for the amount of time the programmer has decided is Ok for potentially stale data to be cached.
Install the plugin from http://craz8.com/svn/trunk/plugins/action_cache
Hey Tom! How are you?
You say:
The Action Cache replacement plugin allows this (cached url query strings) and more, e.g. the ability to cache based on cookie values.
How do I cache url query strings with your plugin? Can’t find any examples.
Thanks for your time!
Mark Suppes Director of Technology Critical Metrics
I sent you an email with an example of how to do this.
I’ll also put a post together with a more realistic example, probably over the weekend
Thank you for this great plugin. I have observed improper behavior when expiring index action.
I connect some controller to my home page:
then i setup my IndexController to cache the index action with
it caches the result to RAILS_ROOT/tmp/cache/META/mydomain.com/.cache
then when i’m trying to expire index action:
then some strange thing happens – the plugin clears cache for all controllers and actions without any exclusions.
Is there any solution to expire only index page?
This could be a bug. I’m using regular expressions to expire the actions, and this may be a little aggressive.
I would have expected the cached action to be in META/mydomain.com/index/index.cache, but it seems my default action_fragment_key method would give this result.
I check it out and issue a fix in the next week or so.
Hi,
First of all thanks for the plugin, it works beautifully.
Any progress on expiring just the homepage as previously mentioned by DEkart? Expiring the homepage currently yields:
Expired fragments matching: ./localhost-3000/.
which pretty muches flushes everything. :)
Using the key override method in your controller, you can change the key the cache uses for the home page to something like localhost-3000/controller/action_name. Then when you expire it, it won’t wipe out the whole cache.
I’ve spent some time working with the action cache recently, and I don’t really like the expiry mechanism I’m using. It doesn’t work at all if you use memcache for your fragment cache, and it scans a whole bunch of files if your fragment cache is the file system.
Hi, Tom,
I have the same question with Mark Suppes, but you sent email to him , so i can not find the solution to fix my problem, may i have your email for this?
—-—-—-—-—-—-—-——The Action Cache replacement plugin allows this (cached url query strings) and more, e.g. the ability to cache based on cookie values.
How do I cache url query strings with your plugin? Can’t find any examples.
Thanks for your time!