I have a Polymer (single page app) application hosted on firebase. When I deploy a new version to firebase, I'll like firebase to reload the javascript source instead of using cached ones. Is it possible to do that via firebase.json? If so, how? Or do i have to manually add a cache busting url to my build output? Thanks
Adding Webpack or a similar tool to your build is probably the easiest way to go, as there's not currently a way to achieve the desired result with Firebase directly:
How Can I Make Webpack Use a Cache-Busting Suffix?
If you're okay removing the cache completely, you can simply set the related headers for the files you don't want cached in firebase.json
:
{
...
"headers": [{
"source": "build.js",
"headers": [{
"key": "Cache-Control",
"value": "max-age=0"
}]
}],
...
}
See here for more details: https://firebase.google.com/docs/hosting/full-config#headers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With