Skip to content

Instantly share code, notes, and snippets.

@jirawatee
Created January 28, 2020 12:02
Show Gist options
  • Save jirawatee/b5925fd21041dc34e4e92c041c3eecc2 to your computer and use it in GitHub Desktop.
Save jirawatee/b5925fd21041dc34e4e92c041c3eecc2 to your computer and use it in GitHub Desktop.
Configuration in Firebase Hosting
{
"functions": {
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run lint"
]
},
"hosting": {
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"headers": [
{
"source": "**/*.@(eot|otf|ttf|ttc|woff|font.css)",
"headers": [
{
"key": "Cache-Control",
"value": "max-age=31536000" // 60 * 60 * 24 * 365
}
]
},
{
"source": "**/*.@(jpg|jpeg|gif|png)",
"headers": [
{
"key": "Cache-Control",
"value": "max-age=604800" // 60 * 60 * 24 * 7
}
]
},
{
"source": "**/*.@(css|js)",
"headers": [
{
"key": "Cache-Control",
"value": "max-age=86400" // 60 * 60 * 24
}
]
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment