CDN回源的几点问题?

  • 回答 (2)
  • 关注 (0)
  • 查看 (1369)

按下CTRL+f5响应如下:

Response Headers

view source

Access-Control-Max-Age:1800

Cache-Control:public, max-age=7200

Content-Length:146125

Content-Type:text/html; charset=utf-8

Date:Fri, 10 Nov 2017 05:40:50 GMT

Expires:Fri, 10 Nov 2017 07:40:50 GMT

Last-Modified:Fri, 10 Nov 2017 05:40:00 GMT

Proxy-Connection:Keep-Alive

Server:nginx

Vary:Accept-Encoding

via:proxy A

X-Cache-Lookup:Hit From Upstream

X-Cache-Lookup:Hit From Upstream

X-Cache-Lookup:Hit From Upstream

X-Cache-Lookup:Hit From Inner Cluste

X-Daa-Tunnel:hop_count=3

X-NWS-LOG-UUID:87b69fe3-8907-47ca-a826-e91a274b9b8e 13fd2f902e54c7a44871a863d6fb2931

按下f5响应如下:

Access-Control-Max-Age:1800

Cache-Control:max-age=7200

Content-Length:0

Content-Type:text/html; charset=utf-8

Date:Fri, 10 Nov 2017 05:41:49 GMT

Expires:Fri, 10 Nov 2017 07:41:49 GMT

Proxy-Connection:Keep-Alive

Server:NWS_SP

X-NWS-LOG-UUID:94967c37-fa51-43ac-8291-04381c6383cd 13fd2f902e54c7a44871a863d6fb2931

再按下ctrl+f5响应如下:

Access-Control-Max-Age:1800

Cache-Control:max-age=7200

Content-Type:text/html; charset=utf-8

Date:Fri, 10 Nov 2017 05:48:17 GMT

Expires:Fri, 10 Nov 2017 07:48:17 GMT

Last-Modified:Fri, 10 Nov 2017 05:40:00 GMT

Proxy-Connection:Keep-Alive

Server:NWS_SP

Transfer-Encoding:chunked

via:proxy A

X-Cache-Lookup:Hit From MemCache Gz

X-NWS-LOG-UUID:5e807fd6-fbb9-474d-9751-c178a768516f cb241fe1eaa83309dc13288eec0e1cb5

再按下ctrl+f5响应如下:(问题1:明明在内存中缓存了为啥又在磁盘中命中?)

Access-Control-Max-Age:1800

Cache-Control:max-age=7200

Content-Type:text/html;charset=utf-8

Date:Fri, 10 Nov 2017 05:51:35 GMT

Expires:Fri, 10 Nov 2017 07:51:35 GMT

Last-Modified:Fri, 10 Nov 2017 05:00:00 GMT

Proxy-Connection:Keep-Alive

Server:NWS_SP

Transfer-Encoding:chunked

via:proxy A

X-Cache-Lookup:Hit From Disktank Gz

X-NWS-LOG-UUID:62de3fa1-15c1-472d-b579-e4b4cc8dc407 0c2871257850ac0aa3ce73273410bb98

再按下ctrl+f5响应如下:(问题:2:明明上次请求在磁盘中命中了,为啥又回源了?CDN配置的缓存时长也没有失效的。)

Access-Control-Max-Age:1800

Cache-Control:public, max-age=7200

Content-Length:146125

Content-Type:text/html;charset=utf-8

Date:Fri, 10 Nov 2017 05:53:37 GMT

Expires:Fri, 10 Nov 2017 07:53:37 GMT

Last-Modified:Fri, 10 Nov 2017 05:20:00 GMT

Proxy-Connection:Keep-Alive

Server:nws_ocmid_hy

via:proxy A

X-Cache-Lookup:Hit From Upstream

X-Cache-Lookup:Hit From Inner Cluste

X-Cache-Lookup:Hit From Disktank3

X-Daa-Tunnel:hop_count=2

X-NWS-LOG-UUID:8060f4d8-7e51-4035-bfe9-ef2ce7f8c1db a9a19a62e1b08ac7e93bf230d0b98dca

如上问题1、2。CDN团队能帮忙解答下吗?

用户1095817用户1095817提问于
腾讯云CDN团队修改于
推荐

针对问题一:

每台机器的内存资源有限,为多用户共享,当内存资源受限且您访问的资源不是较热时,会进行缓存沉降,因此命中从 MemCache 变为 Disktank3。

针对问题二:

CDN采取的是单一地区多点覆盖的策略,并且采用中心调度系统。您所在的地区运营商下,有多个集群交叉覆盖,并且根据节点负载,请求类型,请求频率以及缓存策略等,会对您的请求进行调度。

根据您提供的信息,初步判断是请求在刷新的时候,被调度到了另一个节点上,导致了非命中的情况发生。您可以在控制台上开启中间源,以优化缓存架构,提升命中率。

用户1095817回答于

Access-Control-Max-Age:1800

Cache-Control:max-age=7200

Content-Type:text/html; charset=utf-8

Date:Fri, 10 Nov 2017 09:34:06 GMT

Expires:Fri, 10 Nov 2017 11:34:06 GMT

Last-Modified:Fri, 10 Nov 2017 09:20:00 GMT

Proxy-Connection:Keep-Alive

Server:NWS_SP

Transfer-Encoding:chunked

via:proxy A

X-Cache-Lookup:Hit From MemCache Gz

X-NWS-LOG-UUID:51f99ad4-51a2-4644-9eb5-7b724174b9df 97f4d63ee025a7dce855a20d775b5b1d

浏览器跟CDN缓存协商时,为啥有时候响应Transfer-Encoding:chunked,有时候又不带。这个是基于什么样策略响应的?

所属标签

可能回答问题的人

  • 腾讯云CDN团队

    5 粉丝0 提问8 回答
  • selenawang

    0 粉丝0 提问0 回答
  • squall

    腾讯 · 高级产品经理 (已认证)

    2 粉丝0 提问3 回答
  • 点量小芹DolitQin520

    5 粉丝0 提问1 回答

扫码关注云+社区

领取腾讯云代金券