Skip to content

Instantly share code, notes, and snippets.

@digitalgeneralist
Created August 11, 2017 16:53
Show Gist options
  • Save digitalgeneralist/1179e7c0b915fea280e763c05401ca5f to your computer and use it in GitHub Desktop.
Save digitalgeneralist/1179e7c0b915fea280e763c05401ca5f to your computer and use it in GitHub Desktop.
Hosting React App on Firebase, PageSpeed Tools Insights needs Cache-Control for your js files (min. 1 week)
{
"hosting": {
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"headers": [ {
"source" : "**/*.@(eot|otf|ttf|ttc|woff|font.css)",
"headers" : [ {
"key" : "Access-Control-Allow-Origin",
"value" : "*"
} ]
}, {
"source" : "**/*.@(js|jpg|jpeg|gif|png)",
"headers" : [ {
"key" : "Cache-Control",
"value" : "max-age=691200"
} ]
}, {
"source" : "404.html",
"headers" : [ {
"key" : "Cache-Control",
"value" : "max-age=300"
} ]
} ]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment