ruby-on-rails-3.1asset-pipeline

Javascript is cached in development mode with asset pipeline


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?


Solution

  • 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.