Azure的CDN - 启用HTTP 304缓存与ETag的 - 托管Web角色 [英] Azure CDN - Enabling HTTP 304 Caching with ETag - Hosted Web Role
问题描述
我们正在努力使 HTTP COM pression (gzip的)和 HTTP 304缓存通过ETag的Azure上的CDN。我们已经发现了使Azure的CDN的COM pression 的一个问题,但现在我们不能让COM pression和ETag缓存( 304S )同时工作。这个问题一直是<一个href=\"http://social.msdn.microsoft.com/Forums/en-US/windowsazuredata/thread/e16a3017-651b-41a7-af2a-d0b0ae1cfe1b\">posted天青论坛这里。
这里是COM $ P $的例子pssed ,而不是HTTP缓存(304)链接:
<一个href=\"https://xxxx.vo.msecnd.net/resourceManager.axd?token=HL80vX5hf3lIAAA&group=core.js\">https://xxxx.vo.msecnd.net/resourceManager.axd?token=HL80vX5hf3lIAAA&group=core.js
块引用>下面是缓存的一个例子(304),但不是COM pressible(gzip的)链接:
<一个href=\"https://xxxx.vo.msecnd.net/resourceManager.axd?token=HL80vX5hf3lIAAA&group=core.png\">https://xxxx.vo.msecnd.net/resourceManager.axd?token=HL80vX5hf3lIAAA&group=core.png
块引用>有谁知道怎么弄的 HTTP缓存(304S)和 HTTP的COM pression 在Azure的CDN合作?
解决方案要知道,如果你要指定这一点很重要如果无 - 匹配或如果-匹配?根据我的经验,大多数用户依赖的修改日期和GET 如果-Modified-Since的
的ETag 更强,如果你需要一个缓存标志与多个编码等给定的实体
有关您的要求,请使用修改/ IF-Modified-Since的并不需要变量缓存基于关闭的编码,这应该工作。
更多信息是在这里:<一href=\"http://stackoverflow.com/questions/3887622/httpwebresponse-lastmodified/3889533#3889533\">HttpWebResponse上次更改
We are trying to enable HTTP compression (gzip) and HTTP 304 Caching via ETags on Azure CDN. We already discovered an issue with enabling Azure CDN Compression, but now we can't get compression and ETag caching (304s) working simultaneously. This issue has been posted to Azure forums here.
Here is an example of the compressed, but not HTTP cacheable (304) link:
https://xxxx.vo.msecnd.net/resourceManager.axd?token=HL80vX5hf3lIAAA&group=core.js
Here is an example of the cacheable (304), but not compressible (gzip) link:
https://xxxx.vo.msecnd.net/resourceManager.axd?token=HL80vX5hf3lIAAA&group=core.png
Does anyone know how to get HTTP Caching (304s) and HTTP Compression working together on the Azure CDN?
解决方案It is important to know if you are specifying If-None-Match or If-Match? Based on my experience, most users rely on modification date and GET If-Modified-Since.
ETag is stronger if you need to a cache flag for a given entity with multiple encodings, etc.
For your requirement please use Modified/If-Modified-Since and you don't need variable caching based off encodings and this should work.
More info is here: HttpWebResponse LastModified
这篇关于Azure的CDN - 启用HTTP 304缓存与ETag的 - 托管Web角色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!