[英]Firebase Hosting - Clear Cache
按照 Firebase 教程实现 Firebase 托管。 在控制台中托管应用程序。 但问题是当我更改了 html 模板并通过运行在 Firebase 控制台中重新部署时
ionic build --browser
和
firebase deploy
它正在部署,但未在移动浏览器中更新。
例如,我创建了一个离子和角度演示项目。 使用 InAppBrowser 可以连接 Firebase url
this.iab.create('https://xxx-xxxx.firebaseapp.com','_blank',"location=no,clearsessioncache=yes,clearcache=yes");
但是当我尝试在应用程序设置中清除应用程序缓存时。 然后我得到输出
上面带有更新文本的图像。 上传到 firebase 后的预期结果。
下面的片段试图限制缓存。
1. clearsessioncache=yes,clearcache=yes given in InAppBrowser
2.在Firebase.json
"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"
} ]
}, {
"source" : "404.html",
"headers" : [ {
"key" : "Cache-Control",
"value" : "max-age=300"
} ]
} ],
"cleanUrls": true
我不确定,问题出在 InAppBrowser 或默认浏览器上,还是需要在 ionic 3 应用程序中完成任何配置?
尝试使用以下方法清除所有缓存:
"headers": [
{
"source": "**",
"headers": [
{
"key": "Cache-Control",
"value": "no-cache, no-store, must-revalidate"
}
]
}
]
然后再添加 css、image 和 404。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.