0

I am making a rails website and have it so when i deploy to prod it precompiles all my js files to one application.js file as expected. The issue though is that when i push to my prod server my html is getting updated for users but their browser is caching the application.js file so none of the javascript updates for them and it ends up crashing the website until they clear their cache. I want to add versioning like i can do in other systems where i can do something like application.js?v=12 but here

 <%= javascript_include_tag "application" %>

i try modifying the filename but it wont let me. Am i doing something wrong and is there a way to version this file?

Tomer Shemesh
  • 10,278
  • 4
  • 21
  • 44
  • I think this will answer your question: http://stackoverflow.com/questions/10004365/clear-the-cache-from-the-rails-asset-pipeline – boszlo Jul 13 '15 at 14:25
  • `bundle exec rake assets:clean` should do the trick. This will clean out old assets and generate a new manifest. If you don't want to worry about this use capistrano to deploy your applications, it contains a step that does this fully automated. – Jens Jul 13 '15 at 15:40

0 Answers0