Jonathan Rochkind
2010-Apr-27 19:20 UTC
cache logic in js_include_tag and stylesheet_link_tag?
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Robert Walker
2010-Apr-29 18:57 UTC
Re: cache logic in js_include_tag and stylesheet_link_tag?
Jonathan Rochkind wrote:> 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?I see the same behavior, and I basically use the same solution. Probably not a bad idea to add a step to your Capistrano (or whatever deploy tool) to delete those files on each deployment. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Jonathan Rochkind
2010-Apr-29 19:05 UTC
Re: cache logic in js_include_tag and stylesheet_link_tag?
Robert Walker wrote:> Jonathan Rochkind wrote: >> 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? > > I see the same behavior, and I basically use the same solution. Probably > not a bad idea to add a step to your Capistrano (or whatever deploy > tool) to delete those files on each deployment.Thanks for the response. I''m thinking this is a bug, and I''ll try to go ahead and file it in the tracker, although I lack the Rails fu to fix it myself. In the absence of a fix, could also add something to your Rails app startup routines to delete the files, to work regardless of Capistrano use or not. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi Jonathan Read this also. http://maintainable.com/articles/rails_asset_cache If any modification happens to js or css as specified, then before next release you can apply this trick Sijo -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.