We have an Angular 13 app served on Nginx. Usually, when we deploy new changes, we don't seem them until we do a hard refresh on the page, clearing the cache.
I've seen this issue in a few questions around, but none of the solutions worked so far:
- Angular app has to clear cache after new deployment
- Cache busting after deploying Angular 8 application
- Clear browser cache in Angular
We are using the build command
ng build --prod --aot --output-hashing=all
And angular.json
is configured with
"outputHashing": "all",
in dev and production.
I've tried HTML meta tags:
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
I've searched about more general issues and configurations about cache:
Or could this be caused by a cache config in Nginx? I've looked at A Guide to Caching with NGINX and NGINX Plus, but I'm not very familiarised with Nginx.