Reputation: 13
I have used create-react-app for the front end scripts and using firebase hosting for deployment. Every time I update the CSS and other HTML and deploy them to the hosting, the changed are not reflected on the domain unless I force clear the cache. How can I automatically clear the cache on the browser every time I deploy to the hosting?
Upvotes: 1
Views: 608
Reputation: 599571
The caching happens in your browser, and the browser typically does this based on the caching headers that you tell Firebase Hosting to send back. If you set these headers too short, you'll end up reloading files that haven't been modified, wasting both your and your users' bandwidth. If you set the headers too long, users may end up seeing stale content, as you're discovering.
You can either:
Upvotes: 1