After deploying a new version of the application, some users are still loading older versions, causing errors. It appears that static files are being cached by the browser, leading to incompatibilities between the API and the outdated frontend.
Expected Behavior
Users should automatically load the latest version of the application after an update without experiencing issues due to cached files in the browser.
Steps to Reproduce
Deploy a new version of the Angular/NestJS application.
Access the application in a browser that has cached an older version.
Notice that certain static resources (JS/CSS) are still being loaded from the cache, resulting in compatibility issues with the API.
Possible Solutions :
Use cache-busting via Angular CLI (ensure outputHashing is enabled in angular.json).
Set up a Service Worker to invalidate the cache when new versions are available.
Add HTTP headers like Cache-Control: no-store on the NestJS backend to prevent server-side caching.
Implement an automatic application reload using a version.json file or the SwUpdate service to force the app to reload for users when a new version is detected.
Description
After deploying a new version of the application, some users are still loading older versions, causing errors. It appears that static files are being cached by the browser, leading to incompatibilities between the API and the outdated frontend.
Expected Behavior
Users should automatically load the latest version of the application after an update without experiencing issues due to cached files in the browser.
Steps to Reproduce
Possible Solutions :