Ruby on Rails Tuesday, April 27, 2010

So using the magic :cache argument to combine multiple CSS or JS files
into one cached file, using stylesheet_link_tag or
javascript_include_tag respectively...

I sort of figured that if the arguments to the function changed,
including different files.... the combined cached file would be
re-generated.

This does not seem to be the case.

javascript_include_tag "a", "b", :cache => "my_key"

Stop application. Edit the code to be:

javascript_include_tag "a", "b", "c", :cache => "my_key"

Restart the application. Run it. The combined cached my_key.js file
still only includes "a" and "b", the cached file was not invalidated
when I added "c" to it. I had to go and find the file and rm it myself.

Is this a bug? Or is this expected behavior? Is there something I'm
missing? Under what circumstances is the cached file supposed to be
regenerated? If the last-modified timestamp changes on one of the
included files, will it be regenerated? Will it EVER be re-generated?
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment