Forum: Ruby on Rails Browser using cached JavaScript assets despite them being modified in Rails 3.1

B6455d7e056d218f1ff5988c926bdda5?d=identicon&s=25 teejayvanslyke (Guest)
on 2011-08-31 21:12
(Received via mailing list)
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.
54404bcac0f45bf1c8e8b827cd9bb709?d=identicon&s=25 7stud -- (7stud)
on 2011-09-01 09:04
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.
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.