【发布时间】:2018-07-04 22:53:06
【问题描述】:
我是第一次在 Google Cloud Platform 上使用 Firebase,我已经上传了我的静态网站,但现在我想添加:
"headers": [ {
"source" : "**/*.@(eot|otf|ttf|ttc|woff|font.css)",
"headers" : [ {
"key" : "Access-Control-Allow-Origin",
"value" : "*"
} ]
}, {
"source" : "**/*.@(jpg|jpeg|gif|png)",
"headers" : [ {
"key" : "Cache-Control",
"value" : "max-age=7200"
} ]
}, {
// Sets the cache header for 404 pages to cache for 5 minutes
"source" : "404.html",
"headers" : [ {
"key" : "Cache-Control",
"value" : "max-age=300"
} ]
} ]
启用利用浏览器缓存,但我不明白如何将这些代码行添加到 firebase.json 文件? firebase init 命令会在项目目录的根目录中创建一个 firebase.json 设置文件,但是在创建站点后如何更改它?
非常感谢
【问题讨论】:
标签: json firebase firebase-hosting web-site-project