【发布时间】:2019-10-21 02:25:44
【问题描述】:
我正在像这样使用 gatsby netlify 插件:
resolve: `gatsby-plugin-netlify`,
options: {
headers: {
"/*.js": [
"cache-control: public, max-age=31536000, immutable",
],
"/*.css": [
"cache-control: public, max-age=31536000, immutable",
],
"/sw.js": [
"cache-control: public, max-age=0, must-revalidate",
],
},
},
},
但是,当我向网站发布更新时,浏览器在手动点击“刷新”之前不会看到它。只需访问该网站(无需点击刷新)即可显示旧版本。
【问题讨论】:
-
我在使用服务人员时遇到了类似的问题。我删除了 gatsby service worker 插件,它解决了我遇到的一些缓存问题。