How to cache Angular static assets by setting Cache-Control headers

  angular, firebase

I have an Angular 10 project and when I do an ng build --prod, the static assets are generated in dist directory. When the request is made to get these assets in the dist folder (js, png, jpg files), I want to set the Cache-Control header with a max-age. I’m using firebase for hosting and deploying. How can I add the cache header?

enter image description here

Tagging firebase in case there’s something there I can use.

Source: Angular Questions

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.