Firebase Hosting: cache busting scripts on deploy

我与影子孤独终老i 提交于 2019-12-04 14:44:58

Adding Webpack or a similar tool to your build is probably the easiest way to go, as there's not currently a way to achieve the desired result with Firebase directly:

How Can I Make Webpack Use a Cache-Busting Suffix?

If you're okay removing the cache completely, you can simply set the related headers for the files you don't want cached in firebase.json:

{
  ...
  "headers": [{
      "source": "build.js",
      "headers": [{
        "key": "Cache-Control",
        "value": "max-age=0"
      }]
  }],
  ...
}

See here for more details: https://firebase.google.com/docs/hosting/full-config#headers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!