You don't want your client side code cached in dev. Else you are going to spend a lot of time clearing caches, and you are going to spend a lot of time figuring out why things don't work, only for it to be a "oops, I didn't clear my cache" issue.
You do want it cached for your releases. This is easily accomplished via configuration in your build process -- you can append some build specific info to the file names of your build artifacts, and the browser will cache the content for your. When a new release comes, the names of the relevant files are different so the browser will search for them.
发布评论
评论(1)
我想我不同意。
您不希望您的客户端代码缓存在 dev 中。否则,您将花费大量时间清除缓存,并且您将花费大量时间找出为什么事情不起作用,结果只是“哎呀,我没有清除缓存”问题。
您确实希望为您的版本缓存它。这可以通过构建过程中的配置轻松完成——您可以将一些特定于构建的信息附加到构建工件的文件名中,浏览器将为您缓存内容。当新版本发布时,相关文件的名称会有所不同,因此浏览器将搜索它们。
I think I disagree.
You don't want your client side code cached in dev. Else you are going to spend a lot of time clearing caches, and you are going to spend a lot of time figuring out why things don't work, only for it to be a "oops, I didn't clear my cache" issue.
You do want it cached for your releases. This is easily accomplished via configuration in your build process -- you can append some build specific info to the file names of your build artifacts, and the browser will cache the content for your. When a new release comes, the names of the relevant files are different so the browser will search for them.