Am I fine to use a cache-control max age of 1 year as it looks like (and I have read) that on deploy everything is invalidated on the CDN.
Is there any way to see CDN stats of hits/misses, locations etc. I do use Google Analytics.
What is the correct way to set a cache-control header on index.html, the following don't seem to work and I get the usual max-age=3600 response. Posting the full firebase.json incase something conflicts.
Thanks in advance!!
{
"hosting": {
"public": "public",
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
],
"headers": [ {
"source" : "**/*.@(eot|otf|ttf|ttc|woff|font.css)",
"headers" : [ {
"key" : "Access-Control-Allow-Origin",
"value" : "*"
} ]
}, {
"source" : "**/*.@(jpg|jpeg|gif|png|ico|webp|js)",
"headers" : [ {
"key" : "Cache-Control",
"value" : "max-age=604800"
} ]
}, {
"source" : "**/*.@(html|css",
"headers" : [ {
"key" : "Cache-Control",
"value" : "max-age=7200"
} ]
}, {
"source" : "index.html",
"headers" : [ {
"key" : "Cache-Control",
"value" : "max-age=604800"
} ]
} ]
}
}