Azure CDN清除不刷新缓存的内容 [英] azure cdn purge not refreshing cached content

查看:259
本文介绍了Azure CDN清除不刷新缓存的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个连接到Blob存储的Azure CDN(Verizon,高级版).我在此

I have an Azure CDN (Verizon, premium) connected to blob storage. I have 2 rules in place based on step 6 in this tutorial. The rules are designed to force the CDN to serve "index.html" when the root of the CDN is called. They may or may not be relevant to the issue, but they are described in Step 6 as follows:

  1. 确保下拉菜单中显示"IF"和始终"
  2. 两次单击功能"旁边的"+"按钮.
  3. 将两个新创建的下拉菜单设置为"URL Rewrite"
  4. 将所有源和目标下拉列表设置为您创建的端点(具有端点名称的值)
  5. 对于第一个源模式,设置为((?:[^ \?] /)?)($ | \?.)
  6. 对于第一个目标模式,设置为$ 1index.html $ 2
  7. 对于第二个源模式,设置为((?:[^ \?] /)?[^ \?/.] +)($ | \ ?. )
  8. 对于第二个目标模式,设置为$ 1/index.html $ 2
  1. Make sure the dropdown says "IF" and "Always"
  2. click on "+" button next to "Features" twice.
  3. set the two newly-created dropdowns to "URL Rewrite"
  4. set the all the sources and destination dropdowns to the endpoint you created (the value with the endpoint name)
  5. for the first source pattern, set to ((?:[^\?]/)?)($|\?.)
  6. for the first destination pattern, set to $1index.html$2
  7. for the second source pattern, set to ((?:[^\?]/)?[^\?/.]+)($|\?.)
  8. for the second destination pattern, set to $1/index.html$2

我最初将文件上传到Blob存储,能够通过CDN命中它们(证明上述规则正常工作),然后更改了本地文件(调试)以上传到Blob存储.在更新了Blob存储上的所有文件并在选中全部清除"选项的情况下手动清除CDN终结点之后,CDN为我提供了旧文件,而直接访问Blob存储时为我提供了新文件.似乎对于每个文件都会发生这种情况(即使直接命中该文件,而不仅仅是index.html).在等待约10个小时,清除浏览器缓存并尝试使用从未曾用于访问CDN的浏览器后,仍然会发生这种情况.

I initially uploaded files to blob storage, was able to hit them via the CDN (demonstrating the above rules worked correctly), and then made changes to the local files (debugging) for uploading to blob storage. After updating all files on blob storage and manually purging the CDN endpoint with the "purge all" option checked, I am served the old files by the CDN, and the new files when hitting blob storage directly. This seems to occur for every file (even when hitting the file directly, not just index.html). This still occurs after waiting ~10hrs, clearing browser cache, and trying browsers never before used to access the CDN.

有人知道会发生什么吗?它缓存在我的网络和CDN端点之间的某个位置吗?我觉得我可能缺少了一些非常简单的内容...

Does anyone know what may be occurring? Is it cached somewhere between my network and the CDN endpoint? I feel like I'm probably missing something very simple...

edit 1:我有另一个Verizon(非高级)CDN连接到同一存储容器,它在清除后会拾取正确的文件;但是,即使现在(24小时后),高级CDN也不提供更新的文件.

edit 1: I have another Verizon (non-premium) CDN connected to the same storage container, and it picks up the correct files after a purge; however, even now (24 hrs later) the premium CDN is not serving the updated files.

edit 2:称为Microsoft对Azure的支持,他们花了大约6个小时进行调查,但无济于事.我们最终尝试再次清除,现在正在发送更新的文件.仍然不确定是什么问题.

edit 2: Called Microsoft support for Azure, and they spent about 6 hours investigating to no avail. We eventually tried purging again, and now the updated files are being sent. Still not sure what the issue was.

推荐答案

在与Microsoft和Verizon Digital Media支持人员合作了数周之后,他们终于找到了解决方案.

After working with Microsoft and Verizon Digital Media support for a number of weeks, they finally figured out the solution.

为了避免干扰清除过程,最简单的方法是在规则的功能"部分之前实现以下"IF"语句:

In order to avoid interfering with the purge process, the easiest method is to implement the following "IF" statement before the "Features" portion of your rule:

IF |要求标题通配符|姓名|用户代理|不匹配|价值观| ECPurge/* |忽略大小写(已选中)

IF | Request Header Wildcard | Name | User-Agent | Does Not Match | Values | ECPurge/* | Ignore Case (checked)

对于使用清除用户代理发出的请求,此if语句将完全跳过此规则,从而使该请求能够正常访问CDN.

This if statement will skip this rule altogether for requests made with the purge user agent, allowing the request to hit the CDN as normal.

这篇关于Azure CDN清除不刷新缓存的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆