Azure Verizon CDN-100%缓存CONFIG_NOCACHE [英] Azure Verizon CDN - 100% Cache CONFIG_NOCACHE

查看:165
本文介绍了Azure Verizon CDN-100%缓存CONFIG_NOCACHE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几天前,我如下设置了Azure Verizon Premium CDN:



来源:Azure Web应用程序(.NET MVC 5个网站)

设置:自定义域,不进行地理过滤

缓存规则:标准缓存(不关心参数)

压缩:已启用

已优化:动态网站加速

协议:HTTP,HTTPS,自定义域HTTPS

规则:通过规则引擎强制HTTPS(如果请求方案= http,则301重定向到https:// { customdomain} / $ 1)



所以-这个CDN已经运行了几天,但是ADN报告说缓存中有将近100%(99.36%)状态为 CONFIG_NOCACHE(描述:该对象配置为从不根据边缘服务器上驻留的客户特定配置进行缓存,因此响应是通过原始服务器提供的。)只有少数(0.64%) em是 NONE(描述:此请求已完全绕过缓存。例如,该请求立即被令牌auth模块拒绝,或者客户端请求方法使用了不可缓存的请求方法,例如 PUT。)此外,在缓存命中报告中,它表示 0个命中,0个未命中每天都没有。



我在搜索时找不到这些确切的消息,但是我已经尝试过:




  • 将缓存控制标头更新为max-age,public(即:cache-control:public,max-age = 1209600)

  • 将缓存控制标头更新为max-age(缓存控制:max-age = 1209600)

  • 将expires标头更新为未来的日期方式(到期时间:2038年1月19日,星期二,格林尼治标准时间)

  • 使用不同的浏览器,因此请求缓存信息不同。在Chrome中,请求为我的浏览器中的 cache-control:no-cache。在Firefox中,它会说 Cache-Control:max-age = 0。无论如何,我认为网站上的用户不会拥有这些设置对吗?

  • 刷新页面很多次,并查看实时报告以查看命中/未命中/缓存状态,并且显示出相同的内容-CONFIG_NOCACHE几乎适用于所有内容。

  • 尝试在



    最终,我希望大多数请求都被缓存,因此我希望大多数请求都是 TCP Hit。也许那是不正确的?预先感谢您的帮助!

    解决方案

    所以,我最终弄清楚了这个问题。显然,Azure Verzion Premium CDN ADN平台默认情况下启用了旁路缓存。



    要禁用此行为,您需要为缓存规则配置其他功能。



    示例:



    如果总是

    功能:

    绕过缓存已禁用

    强制内部最大值-Age Response 200 864000 Seconds

    忽略原始无缓存200


    I set up an Azure Verizon Premium CDN a few days ago as follows:

    Origin: An Azure web app (.NET MVC 5 website)
    Settings: Custom Domain, no geo-filtering
    Caching Rules: standard-cache (doesn't care about parameters)
    Compression: Enabled
    Optimized for: Dynamic site acceleration
    Protocols: HTTP, HTTPS, custom domain HTTPS
    Rules: Force HTTPS via Rules Engine (if request scheme = http, 301 redirect to https://{customdomain}/$1)

    So - this CDN has been running for a few days now, but the ADN reports are saying that nearly 100% (99.36%) of the cache status is "CONFIG_NOCACHE" (Description: "The object was configured to never be cached in accordance with customer-specific configurations residing on the edge servers, so the response was served via the origin server.") A few (0.64%) of them are "NONE" (Description: "The cache was bypassed entirely for this request. For instance, the request was immediately rejected by the token auth module, or the client request method used an uncacheable request method such as "PUT".") Also, in the "Cache Hit" report, it says "0 hits, 0 misses" for every day. Nothing is coming through the "HTTP Large" side, only "ADN".

    I couldn't find these exact messages while searching around, but I've tried:

    • Updating cache-control header to max-age, public (ie: cache-control: public,max-age=1209600)
    • Updating the cache-control header to max-age (cache-control: max-age=1209600)
    • Updating the expires header to a date way in the future (expires: Tue, 19 Jan 2038 03:14:07 GMT)
    • Using different browsers so the request cache info is different. In Chrome, the request is "cache-control: no-cache" in my browser. In Firefox, it'll say "Cache-Control: max-age=0". In any case, I'd assume the users on the website wouldn't have these same settings, right?
    • Refreshing the page a bunch of times, and looking at the real time report to see hits/misses/cache statuses, and it shows the same thing - CONFIG_NOCACHE for almost everything.
    • Tried running a "worldwide" speed test on https://www.dotcom-tools.com/website-speed-test.aspx, but that had the same result - a bunch of "NOCACHE" hits.
    • Tried adding ADN rules to set the internal and external max age to 864000 sec (10 days).
    • Tried adding an ADN rule to ignore "no-cache" requests and just return the cached result.

    So, the message for "NOCACHE" says it's a node configuration issue... but I haven't really even configured it! I'm so confused. It could also be an application issue, but I feel like I've tried all the different permutations of "cache-control" that I can. Here's an example of one file that I'd expect to be cached:

    Ultimately, I would hope that most of the requests are being cached, so I'd see most of the requests be "TCP Hit". Maybe that's incorrect? Thanks in advance for your help!

    解决方案

    So, I eventually figured out this issue. Apparently Azure Verzion Premium CDN ADN platform has "bypass cache" enabled by default.

    To disable this behavior you need to configure additional features to your caching rules.

    Example:

    IF Always
    Features:
    Bypass Cache Disabled
    Force Internal Max-Age Response 200 864000 Seconds
    Ignore Origin No-Cache 200

    这篇关于Azure Verizon CDN-100%缓存CONFIG_NOCACHE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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