Reputation: 461
On updating a new version of my Angular4 site. The images are not re-downloaded on new version update. Browser continues using cached assets until we manually clear the cache. I am using ng-cli for deployment.
Upvotes: 1
Views: 1145
Reputation: 18387
You can use a version param in your image URL as follow
https://example.com/assets/images/foo.png?v=1.0.
Then you can up the version number whenever the image is updated to force the browser to refetch. (cache busting).
<!-- In your html -->
https://example.com/assets/images/foo.png?v={{assetVersion}}.
Upvotes: 1