简体   繁体   English

捆绑Web服务器场上的缓存破坏者

[英]Bundle cache-busters on a web server farm

The ASP.NET Bundling and Minification tutorial states: ASP.NET捆绑和缩小教程说明:

The query string v has a value token that is a unique identifier used for caching. 查询字符串v具有值令牌,该值令牌是用于缓存的唯一标识符。 As long as the bundle doesn't change, the ASP.NET application will request the AllMyScripts bundle using this token. 只要捆绑包不变,ASP.NET应用程序就会使用此令牌请求AllMyScripts捆绑包。 If any file in the bundle changes, the ASP.NET optimization framework will generate a new token, guaranteeing that browser requests for the bundle will get the latest bundle. 如果捆绑软件中的任何文件发生更改,则ASP.NET优化框架将生成一个新令牌,以确保浏览器对捆绑软件的请求将获得最新的捆绑软件。

How does this work on a web server farm? 这在Web服务器场上如何工作?

If I update a javascript file included in a bundle, will the new query string be the same across my web farm? 如果我更新捆绑包中包含的javascript文件,新的查询字符串在我的Web场中是否相同?

The v query string is just a hash of the contents of that bundle. v查询字符串只是该捆绑包内容的哈希值。 If the same set of Javascript files are deployed to all servers in your farm, the hash should be the same, resulting in a the same v value on all servers. 如果将相同的Javascript文件集部署到服务器场中的所有服务器,则哈希值应相同,从而在所有服务器上产生相同的v值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM