最新消息:20210917 已从crifan.com换到crifan.org

【整理】webpack生成文件中实现cache busting缓存破解

ReactJS crifan 3806浏览 0评论

Understanding React deployment – Bartosz Szczeciński – Medium

中出现了:

cache busting

缓存破解

就是知道:

对于浏览器缓存了(js,html)等内容时

对于用户是不太懂如何去清除缓存的

所以才有对应的技术去避免此问题:

cache busting

缓存破解

做法是:

给文件名加上hash值

对应着react中的配置就是:

module.exports = {
  // base config
  output: {
    filename: “[name].[hash].js”
  }
}

转载请注明:在路上 » 【整理】webpack生成文件中实现cache busting缓存破解

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
99 queries in 0.197 seconds, using 23.44MB memory