patek.cz/firebase.json
Vojtěch Káně b0d578dbe4 Fix Cache-Control headers for files under img dir
The glob pattern did not work (probably issues with the negation).

RE2 (Google's high performance RegEx engine) does not support negation either, that's why it has to be expanded this way (negated character groups are supported).

Glob patterns are not matched against the leading slash, but regexes are (undocumented, but observed).

Relates to !43 and therefore ae3148337b (the behavior finaly matches the description).
2020-10-10 10:48:53 +02:00

40 lines
744 B
JSON

{
"hosting": {
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"headers": [
{
"source": "@(js|css)/*.@(js|css)",
"headers": [
{
"key": "Cache-Control",
"value": "max-age=2628000"
}
]
},
{
"source": "img/**",
"headers": [
{
"key": "Cache-Control",
"value": "max-age=86400"
}
]
},
{
"regex": "^/(?:[^i]|i[^m]|im[^g])[^/]*/.*[.](?:jpg|jpeg|png|webp)$",
"headers": [
{
"key": "Cache-Control",
"value": "max-age=2628000"
}
]
}
]
}
}