0

working on a website built with python and angular but after every single change I need to hard reset browser to see it. I see this is a problem in general so what's the best approach for caching js and css resources ? right now I dont care if each file will be called on every single page if there is no other option.

user1751287
  • 491
  • 9
  • 26
  • Possible duplicate of [How to force browser to reload cached CSS/JS files?](http://stackoverflow.com/questions/118884/how-to-force-browser-to-reload-cached-css-js-files) – Leonid Vasilev Apr 20 '17 at 16:30

2 Answers2

1

Are you referring to development time? If so, this can often be set in the browser. Which browser are you using? For Chrome:

  1. Open the developer tools.
  2. Select the network tab.
  3. Check the Disable cache checkbox
DeborahK
  • 57,520
  • 12
  • 104
  • 129
1

For testing/deployment, consider building the files with a unique number attached to them so that the browser sees them as new files.

The easiest way to perform these builds is to use the angular CLI build process: github.com/angular/angular-cli/wiki/build.

The screenshot below is from John Papa's excellent Angular CLI course on Pluralsight.

enter image description here

DeborahK
  • 57,520
  • 12
  • 104
  • 129