Ruby on Rails Wednesday, August 31, 2011

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@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