我的Cache-Control
中的firebase.json
标头似乎不起作用。所有文件的max-age
值均设置为31536000
(1年),但是在加载页面时,仍将其设置为浏览器默认值3600
(1小时)。
firebase.json
文件似乎遵守firebase documentation.
{
"hosting": {
"public": "public"
},
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"headers": [{
"source": "**",
"headers": [{
"key": "Cache-Control",
"value": "max-age=31536000"
}]
}]
}
这必须工作:
{
"hosting": {
"public": "app",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"headers": [{
"source" : "**",
"headers" : [{
"key" : "Cache-Control",
"value" : "max-age=31536000"
}]
}]
}
}