guys, I have a problem with chrome caching in an angular/cli project.I'm using angular 4 and when I make some changes in HTML, CSS or JS files and deploy it on the server my chrome can not show the new changes and when I clear browser cache it shows them.
Asked
Active
Viewed 1,117 times
0
-
I had similar issues when I had a web-worker actived. You can unregister them in Chrome Dev Tools => Application => Service Workers while visiting the app. – mchl18 Jul 29 '18 at 05:26
-
1I actually resolve the issue. In the Nginx config in web server, I just excluded the expiry for index.html – Mohammadreza Imani Jul 30 '18 at 06:08
3 Answers
0
You can use Cache-Control headers. For e.g.
Cache-Control: no-cache, no-store, must-revalidate.
References :

Praveen Rai
- 777
- 1
- 7
- 28
0
The minimal configs needed to be set on the response header.
- set "Cache-Control" with value "no-cache, no-store, must-revalidate"
- set "Pragma" with "no-cache" // HTTP 1.0.
- set "Expires" with "0"
With these values set, most of the browsers should not do caching.
Reference from How do we control web page caching, across all browsers?

Bimal Parajuli
- 37
- 4
-1
I had a similar issue too, my app was on NGINX, and I've added a header to NGINX config. file

Mohammadreza Imani
- 430
- 5
- 13

Amir Nasehi
- 1
- 1