Cloudfront 被锁定 index.html
Cloundfront gets locked on index.html
我有以下分布。
https://dhzcuvpl3uus.cloudfront.net
为了相似起见,我有 2 个对象:
- index.html
- manifest.json
当我第一次(在硬缓存或隐身模式之后)访问 manifest.json
(https://dhzcuvpl3uus.cloudfront.net/manifest.json) 对象时,我可以看到内容。
但是,在访问 index.html
对象后,我无法访问 manifest
json。即使我通过 url.
请求 manifest.json
对象,它也会显示 index.html
可以用硬缓存修复。
这种行为的原因是什么?
原因是您的清单有效。
在您的清单中,您有
"start_url": "./index.html"
在你的 index.html 中你有:
<link rel="manifest" href="/manifest.json">
所以一旦 index.html 被调用你的浏览器缓存你的 "Web Application" 开始 URL 是 ./index.html ...
即使您尝试访问 -> https://dhzcuvpl3uus.cloudfront.net/shazam
它将从 manifest.json
中调用浏览器缓存中的内容
./index.html
Tl 博士:您的清单正在运行,您的浏览器正在缓存。
我有以下分布。 https://dhzcuvpl3uus.cloudfront.net
为了相似起见,我有 2 个对象:
- index.html
- manifest.json
当我第一次(在硬缓存或隐身模式之后)访问 manifest.json
(https://dhzcuvpl3uus.cloudfront.net/manifest.json) 对象时,我可以看到内容。
但是,在访问 index.html
对象后,我无法访问 manifest
json。即使我通过 url.
manifest.json
对象,它也会显示 index.html
可以用硬缓存修复。
这种行为的原因是什么?
原因是您的清单有效。
在您的清单中,您有
"start_url": "./index.html"
在你的 index.html 中你有:
<link rel="manifest" href="/manifest.json">
所以一旦 index.html 被调用你的浏览器缓存你的 "Web Application" 开始 URL 是 ./index.html ...
即使您尝试访问 -> https://dhzcuvpl3uus.cloudfront.net/shazam 它将从 manifest.json
中调用浏览器缓存中的内容./index.html
Tl 博士:您的清单正在运行,您的浏览器正在缓存。