amazon-web-services - Cloudfront 被锁定在 index.html
问题描述
我有以下分布。 https://dhzcuvpl3uus.cloudfront.net
为了相似起见,我有两个对象:
- 索引.html
- 清单.json
当我第一次访问(在硬缓存或 icognito 模式之后)manifest.json
(https://dhzcuvpl3uus.cloudfront.net/manifest.json)对象时,我可以看到内容。
但是,在访问index.html
对象后,我无法访问manifest
json。即使我manifest.json
通过 url 请求对象,它也会显示 index.html。
它可以用硬缓存修复。
这种行为的原因是什么?
解决方案
原因是您的清单正在工作。
在你的清单上,你有
"start_url": "./index.html"
在您的 index.html 中,您有:
<link rel="manifest" href="/manifest.json">
因此,一旦调用 index.html,您的浏览器就会缓存您的“Web 应用程序”起始 URL 为 ./index.html ...
即使您尝试访问 -> https://dhzcuvpl3uus.cloudfront.net/shazam ,它也会从 manifest.json 调用浏览器缓存中的内容
./index.html
Tl dr:您的清单正在运行,并且您的浏览器正在缓存。
推荐阅读
- android - Android Emulator 未在键盘上显示键
- ios - iOS 延长信标监控的后台时间
- php - 如何使用 PHP while 语句构建多维 json 数组?
- java - 单击按钮时显示叠加层,使用 Swing 执行操作时再次消失
- javascript - 使用office js用密码加密Microsoft Excel
- python - 强制非阻塞 UDP 套接字在 sendto 上引发 BlockingIOError
- java - 在 Java 中使用 elasticsearch 滚动时程序一直运行
- angular - Search Popup 组件如何以角度与其他两个组件通信
- mysql - 如何连接一行中的重复元素?
- bash - 用换行符替换回车后如何将终端中的 dd 进度重定向到日志文件