0

I'm facing an issue regarding cache in browser. Whenever I'm deploying new Angular UI the cache of Older remains untill I clear the browser cache manually.

How can I solve this

Thanks in advance for help

Need a solution to solve this problem.

9
  • you can hard refresh, caching is done to improve the performance of the website Commented Aug 12, 2024 at 7:13
  • If you are not using SSR, you can disable caching for the index.html file. It is very small, so performance should not be a big deal. If you are using output hashing, the new UI should load right after deployment. Which web server technology do you use? Nginx / IIS / Apache? Then we can help you setting up the right config. Commented Aug 12, 2024 at 7:30
  • I don't think this is a duplicate of the linked question. Angular does output hashing by default which takes care of caching the CSS and JS files. I think this is only about the index.html, where you cannot apply output hashing via query params. Commented Aug 12, 2024 at 7:31
  • @JSONDerulo so, it's not about controlling the browser cache. OP simply wants to control the browser cache? Commented Aug 12, 2024 at 7:33
  • 1
    @JSONDerulo setting the cache control headers (Cache-Control, If-Modified-Since, ETag, etc.) affect all resources: JS, CSS, but also images, fonts, as well as HTML files. But OK, let's assume that's not what's asked here. I am fairly confident that "how do I do cache busting (for one file)" is not a new and unique problem to solve. After all, this has only been an issue in web development for the last ~30 years or so. Feel free to find a better duplicate. Commented Aug 12, 2024 at 7:53

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.