0

In development phase I am regularly updating js files, I am facing an issue with caching of JS files it's not updating code with ctrl+F5.

I am opening browser in incognito it's taking update file or when I am specifying version in reference file update code is taking in browser.

Please suggest me is there any approach with out specifying version number or opening in private window.

  • Possible duplicate of [Making sure a web page is not cached, across all browsers](http://stackoverflow.com/questions/49547/making-sure-a-web-page-is-not-cached-across-all-browsers) – Deblaton Jean-Philippe Jul 17 '16 at 16:55
  • If you're using Chrome you have a couple options. Open Developer Tools and a) on the Network tab check the "Disable cache" checkbox or b) when you want to refresh right-click on the refresh icon to get a dropdown menu and choose "Empty Cache and Hard Reload". The question linked to in the above comment is fine, but unless you have a reason not to it's best to let the clients cache files in production to avoid having the clients download the same files over and over. – Lex Jul 17 '16 at 17:23

1 Answers1

0

You have different ways to do so:

  • Disable Cache
  • Add a "?version" to the script's src link
Ruslan
  • 91
  • 1
  • 8