I recently upgraded my application to rails 3.1 and generally everything seems to be working but one thing is driving me insane.
I have 2 main js files, we'll call them, application.js and main.js.
application.js has my manifest stuff in it and is loading in main.js. That's working fine. My problem is when i'm in development mode and i make a change to main.js, then refresh the page the site doesn't pick up the change. In order to pull in the change I have restart the rails server.
I have debug mode turned on in development, but I'm wondering if there's another setting i'm missing?
Anyone run into this before?
In general, most modern browsers will cache JavaScript files. This is standard practice for modern browsers and ensures an optimized loading experience. Cached assets such as JavaScript will typically be served from the browser's cache instead of making another request for a resource that has already been retrieved.
The asset pipeline provides a framework to concatenate and minify or compress JavaScript and CSS assets. It also adds the ability to write these assets in other languages and pre-processors such as CoffeeScript, Sass, and ERB.
To compile your assets locally, run the assets:precompile task locally on your app. Make sure to use the production environment so that the production version of your assets are generated. A public/assets directory will be created. Inside this directory you'll find a manifest.
I had the same issue, but config.action_controller.perform_caching
was already set to false.
For me and another guy I was working with, the problem was that Chrome was caching the page despite the settings in Rails.
To fix it, we just closed the tab, opened a new tab, and visited the site again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With