teejayvanslyke
2011-Aug-31 17:15 UTC
Browser using cached JavaScript assets despite them being modified in Rails 3.1
I''ve just upgraded my application to Rails 3.1. I have a fairly complex JavaScript codebase and have opted to concatenate it into a single .js.coffee file to be compiled by Sprockets. Every so often, I''ll make changes to one of my CoffeeScript files, refresh the page, and notice my changes weren''t reflected. Looking at the Chrome debugger, I notice the files aren''t being read from the server (the ''Network'' tab shows ''(from cache)'' on the corresponding files). This seems to happen at random, which makes it very, very frustrating to develop. The only solutions I''ve found are to clear the browser cache or restart the browser. Any ideas? I''ve tried turning :debug on in my javascript_include_tag calls, but was getting the same results. In fact, when I had multiple <script> tags, it seemed that the only assets returning ''(from cache)'' were those I had changed! That''s some irony right there. -- 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.
7stud --
2011-Sep-01 07:04 UTC
Re: Browser using cached JavaScript assets despite them being modified in Rails 3.1
Railsguide says this: Fingerprinting is enabled by default for production and disabled for all the others environments. You can enable or disable it in your configuration through the config.assets.digest option. -- 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.