id: c8a74e107bc14645ae7d24f7f1ad1a87
parent_id: 
item_type: 1
item_id: ebfba8391530426eb6a0c980613a3edc
item_updated_time: 1764345634642
title_diff: "[{\"diffs\":[[1,\"Cloudflare从入门到精通 7. Cache网站加速神器\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":31}]"
body_diff: "[{\"diffs\":[[1,\"<html>\\\r\\\n<head>\\\r\\\n  <title>Cloudflare从入门到精通 7. Cache网站加速神器</title>\\\r\\\n  <basefont face=\\\"微软雅黑\\\" size=\\\"2\\\" />\\\r\\\n  <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html;charset=utf-8\\\" />\\\r\\\n  <meta name=\\\"exporter-version\\\" content=\\\"YXBJ Windows/608924 (zh-CN, DDL); Windows/10.0.0 (Win64); EDAMVersion=V2;\\\"/>\\\r\\\n  <meta name=\\\"content-class\\\" content=\\\"yinxiang.peso.superNote\\\"/>\\\r\\\n  <meta name=\\\"application-data:yinxiang.noteLayout\\\" content=\\\"{\\\"lineSpace\\\":\\\"recommend\\\",\\\"paragraphSpace\\\":\\\"recommend\\\"}\\\"/>\\\r\\\n  <style>\\\r\\\n\\tbody, td {\\\r\\\n\\t  font-family: 微软雅黑;\\\r\\\n\\t  font-size: 12pt;\\\r\\\n\\t}\\\r\\\n  </style>\\\r\\\n</head>\\\r\\\n<body>\\\r\\\n<a name=\\\"43342\\\"></a>\\\r\\\n<h1>Cloudflare从入门到精通 7. Cache网站加速神器</h1>\\\r\\\n\\\r\\\n<div><span style=\\\"\\\"><div style=\\\"max-width: 700px;\\\"><p></p><div style=\\\"--en-blockquote: true; box-sizing: border-box; border-left: 3px solid #b4c0cc; background-position: initial initial; background-repeat: initial initial;\\\"><div>原文链接: <a href=\\\"http://mp.weixin.qq.com/s?__biz=Mzk0NTcxMzU3NQ==&amp;mid=2247483851&amp;idx=1&amp;sn=635175d0bf6f913e2ab873826bb35974&amp;chksm=c2e91733d3f90b44949f32faed88e686475c805474fd4f732e11f069925d432cbaae6e6e2a6e&amp;mpshare=1&amp;scene=1&amp;srcid=0526Et2XDgIjY0jXdb3WlFKO&amp;sharer_shareinfo=8498880e24bf2b364fb6b929e8ee4150&amp;sharer_shareinfo_first=8498880e24bf2b364fb6b929e8ee4150#rd\\\"><span>http://mp.weixin.qq.com/s?__biz=Mzk0NTcxMzU3NQ==&amp;mid=2247483...</span></a></div></div><p></p><div style=\\\"\\\"><div><div><div><span style=\\\"\\\">原创</span><span><span style=\\\"\\\">DeBill</span></span><span><a style=\\\"\\\"> DeBill独立开发 </a></span><span><em></em></span></div><div style=\\\"\\\"><div style=\\\"background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; color: rgb(0, 0, 0); word-spacing: 0em; letter-spacing: 0em; word-break: break-word; text-align: left;\\\"><center><img src=\\\":/b73ef0bf0f01478a89cfc8aa351fc9f1\\\" type=\\\"image/jpeg\\\" data-filename=\\\"640.jpg\\\" style=\\\"--en-marks: %7B%22align%22%3A%22center%22%7D; display: block; width: auto; height: auto;\\\" width=\\\"auto\\\"/></center><h2 style=\\\"background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0 0; background-repeat: no-repeat; background-size: auto; border-style: none; border-width: 1px; border-color: rgb(0,0,0); border-radius: 0; height: auto; overflow: unset; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\\\"><span style=\\\"font-size: 22px; color: rgb(81, 81, 81); letter-spacing: 0em; background-attachment: scroll; background-clip: border-box; background-image: linear-gradient(0deg, rgb(255, 177, 27) 40%, transparent 40%); background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 1px; border-color: rgb(0, 0, 0); border-radius: 0px; display: block; font-weight: bold; overflow: unset; text-indent: 0em; text-shadow: none; transform: none; -webkit-box-reflect: unset;\\\">📜 前言</span></h2><p style=\\\"color: rgb(58,58,58); letter-spacing: 0; text-indent: 0;\\\">前面的文章提到当我们把网站托管到 Cloudflare 且打开小橙云后，Cloudflare 就帮我们自动开启 CDN 加速，但是如果没有进行正确的设置会感觉加速不明显，甚至起到了“反向加速的作用”。除了境内网络线路问题，很大因素是没有正确地配置缓存，导致Cloudflare频繁回源影响网站使用体验。本文给大家详细介绍 Cloudflare Cache 的配置尤其是 Cache Rules 的配置，提升网站访问速度。</p><h2 style=\\\"background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0 0; background-repeat: no-repeat; background-size: auto; border-style: none; border-width: 1px; border-color: rgb(0,0,0); border-radius: 0; height: auto; overflow: unset; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\\\"><span style=\\\"font-size: 22px; color: rgb(81, 81, 81); letter-spacing: 0em; background-attachment: scroll; background-clip: border-box; background-image: linear-gradient(0deg, rgb(255, 177, 27) 40%, transparent 40%); background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 1px; border-color: rgb(0, 0, 0); border-radius: 0px; display: block; font-weight: bold; overflow: unset; text-indent: 0em; text-shadow: none; transform: none; -webkit-box-reflect: unset;\\\">⚙️ 基础设置</span></h2><p style=\\\"color: rgb(58,58,58); letter-spacing: 0; text-indent: 0;\\\">Cache的设置位于 <code style=\\\"color: rgb(155, 110, 35); letter-spacing: 0em; background: none 0% 0% / auto no-repeat scroll padding-box border-box rgb(255, 245, 227); width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgb(0, 0, 0) rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.4); border-radius: 4px; word-break: break-all;\\\">Websites --&gt; Zone --&gt; Caching</code> 在这里你可以设置你网站所有跟CDN缓存相关的内容。</p><p style=\\\"text-align: center;\\\"><img src=\\\":/b3ed6afaee3145918c94313de025e07c\\\" type=\\\"image/jpeg\\\" data-filename=\\\"640.jpg\\\" style=\\\"--en-marks: %7B%22align%22%3A%22center%22%7D; width: auto;\\\" width=\\\"auto\\\"/></p><h3 style=\\\"background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0 0; background-repeat: no-repeat; background-size: auto; border-style: none; border-width: 1px; border-color: rgb(0,0,0); border-radius: 0; height: auto; overflow: unset; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\\\"><span style=\\\"color: rgb(34, 34, 34); letter-spacing: 0em; border-style: none none none solid; border-width: 1px 1px 1px 3px; border-color: rgb(0, 0, 0) rgb(0, 0, 0) rgb(0, 0, 0) rgb(255, 177, 27); border-radius: 0px; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; display: block; font-weight: bold; height: auto; overflow: unset; text-indent: 0em; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\\\">Purge Cache</span></h3><p style=\\\"color: rgb(58,58,58); letter-spacing: 0; text-indent: 0;\\\">这个设置用于立即清除CDN缓存，位于 <code style=\\\"color: rgb(155, 110, 35); letter-spacing: 0em; background: none 0% 0% / auto no-repeat scroll padding-box border-box rgb(255, 245, 227); width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgb(0, 0, 0) rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.4); border-radius: 4px; word-break: break-all;\\\">Websites --&gt; Zone --&gt; Caching --&gt; Configuration --&gt; Purge Cache</code></p><p style=\\\"text-align: center;\\\"><img src=\\\":/6f5bb9c617c946109c8788c1ef119460\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks: %7B%22align%22%3A%22center%22%7D; width: auto;\\\" width=\\\"auto\\\"/></p><p style=\\\"color: rgb(58,58,58); letter-spacing: 0; text-indent: 0;\\\">主要有两个功能: <code style=\\\"color: rgb(155, 110, 35); letter-spacing: 0em; background: none 0% 0% / auto no-repeat scroll padding-box border-box rgb(255, 245, 227); width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgb(0, 0, 0) rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.4); border-radius: 4px; word-break: break-all;\\\">Custom Purge</code>和<code style=\\\"color: rgb(155, 110, 35); letter-spacing: 0em; background: none 0% 0% / auto no-repeat scroll padding-box border-box rgb(255, 245, 227); width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgb(0, 0, 0) rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.4); border-radius: 4px; word-break: break-all;\\\">Purge Everything</code></p><h3 style=\\\"background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0 0; background-repeat: no-repeat; background-size: auto; border-style: none; border-width: 1px; border-color: rgb(0,0,0); border-radius: 0; height: auto; overflow: unset; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\\\"><span style=\\\"color: rgb(34, 34, 34); letter-spacing: 0em; border-style: none none none solid; border-width: 1px 1px 1px 3px; border-color: rgb(0, 0, 0) rgb(0, 0, 0) rgb(0, 0, 0) rgb(255, 177, 27); border-radius: 0px; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; display: block; font-weight: bold; height: auto; overflow: unset; text-indent: 0em; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\\\">Custom Purge</span></h3><p style=\\\"color: rgb(58,58,58); letter-spacing: 0; text-indent: 0;\\\">Custom Purge中文意为「定制化清除」，免费计划的用户只能根据URL来定制，且不支持通配符，最多可以设置30个URL。当用户访问指定URL资源的时候资源就会被清除，这个设置对于清除特定文件很有用。</p><p style=\\\"text-align: center;\\\"><img src=\\\":/5070a5d6ef7743b48e73c7da418f7e7e\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks: %7B%22align%22%3A%22center%22%7D; width: auto;\\\" width=\\\"auto\\\"/></p><h3 style=\\\"background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0 0; background-repeat: no-repeat; background-size: auto; border-style: none; border-width: 1px; border-color: rgb(0,0,0); border-radius: 0; height: auto; overflow: unset; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\\\"><span style=\\\"color: rgb(34, 34, 34); letter-spacing: 0em; border-style: none none none solid; border-width: 1px 1px 1px 3px; border-color: rgb(0, 0, 0) rgb(0, 0, 0) rgb(0, 0, 0) rgb(255, 177, 27); border-radius: 0px; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; display: block; font-weight: bold; height: auto; overflow: unset; text-indent: 0em; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\\\">Purge Everything</span></h3><p style=\\\"color: rgb(58,58,58); letter-spacing: 0; text-indent: 0;\\\">Purge Everhthing 中文意为「立即清除」，当你点击该按钮后，Cloudflare会立即清除其边缘CDN节点里的缓存，这么操作可能会暂时降低用户访问你网站的速度，但是可以提高访问内容的准确性</p><p style=\\\"text-align: center;\\\"><img src=\\\":/6df35a8bb1db4d9d91b3cf39539ce33e\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks: %7B%22align%22%3A%22center%22%7D; width: auto;\\\" width=\\\"auto\\\"/></p><h3 style=\\\"background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0 0; background-repeat: no-repeat; background-size: auto; border-style: none; border-width: 1px; border-color: rgb(0,0,0); border-radius: 0; height: auto; overflow: unset; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\\\"><span style=\\\"color: rgb(34, 34, 34); letter-spacing: 0em; border-style: none none none solid; border-width: 1px 1px 1px 3px; border-color: rgb(0, 0, 0) rgb(0, 0, 0) rgb(0, 0, 0) rgb(255, 177, 27); border-radius: 0px; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; display: block; font-weight: bold; height: auto; overflow: unset; text-indent: 0em; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\\\">Caching Level</span></h3><p style=\\\"color: rgb(58,58,58); letter-spacing: 0; text-indent: 0;\\\">因为用户在获取资源时会在URL添加参数，缓存级别决定CDN应缓存什么类型的静态资源，位于 <code style=\\\"color: rgb(155, 110, 35); letter-spacing: 0em; background: none 0% 0% / auto no-repeat scroll padding-box border-box rgb(255, 245, 227); width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgb(0, 0, 0) rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.4); border-radius: 4px; word-break: break-all;\\\">Websites --&gt; Zone --&gt; Caching --&gt; Configuration --&gt; Cache Level</code></p><p style=\\\"text-align: center;\\\"><img src=\\\":/74b9f308a5d14ddfba6d9f6eceec6dc1\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks: %7B%22align%22%3A%22center%22%7D; width: auto;\\\" width=\\\"auto\\\"/></p><h4 style=\\\"\\\"><span style=\\\"letter-spacing: 0em; font-weight: bold; display: block;\\\">No query string</span></h4><p style=\\\"color: rgb(58,58,58); letter-spacing: 0; text-indent: 0;\\\">仅在没有查询字符串时从缓存中提供资源，例如：<code style=\\\"color: rgb(155, 110, 35); letter-spacing: 0em; background: none 0% 0% / auto no-repeat scroll padding-box border-box rgb(255, 245, 227); width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgb(0, 0, 0) rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.4); border-radius: 4px; word-break: break-all;\\\">debill.cc/pic.jpg</code>，带请求参数的都不返回资源</p><h4 style=\\\"\\\"><span style=\\\"letter-spacing: 0em; font-weight: bold; display: block;\\\">Ignore query string</span></h4><p style=\\\"color: rgb(58,58,58); letter-spacing: 0; text-indent: 0;\\\">无论用户的请求URL是否携带请求参数，都提供一样的资源，例如当用户访问<code style=\\\"color: rgb(155, 110, 35); letter-spacing: 0em; background: none 0% 0% / auto no-repeat scroll padding-box border-box rgb(255, 245, 227); width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgb(0, 0, 0) rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.4); border-radius: 4px; word-break: break-all;\\\">debill.cc/pic.jpg</code></p><h4 style=\\\"\\\"><span style=\\\"letter-spacing: 0em; font-weight: bold; display: block;\\\">Standard</span></h4><p style=\\\"color: rgb(58,58,58); letter-spacing: 0; text-indent: 0;\\\">没有特殊需求选择标准就行</p><h3 style=\\\"background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0 0; background-repeat: no-repeat; background-size: auto; border-style: none; border-width: 1px; border-color: rgb(0,0,0); border-radius: 0; height: auto; overflow: unset; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\\\"><span style=\\\"color: rgb(34, 34, 34); letter-spacing: 0em; border-style: none none none solid; border-width: 1px 1px 1px 3px; border-color: rgb(0, 0, 0) rgb(0, 0, 0) rgb(0, 0, 0) rgb(255, 177, 27); border-radius: 0px; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; display: block; font-weight: bold; height: auto; overflow: unset; text-indent: 0em; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\\\">Browser Cache TTL</span></h3><p style=\\\"color: rgb(58,58,58); letter-spacing: 0; text-indent: 0;\\\">客户浏览器缓存你网站静态资源的时间，默认是4小时，最高可以设置一年，如果你的网站静态资源变更比较少可以将这个值设高一点。位于<code style=\\\"color: rgb(155, 110, 35); letter-spacing: 0em; background: none 0% 0% / auto no-repeat scroll padding-box border-box rgb(255, 245, 227); width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgb(0, 0, 0) rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.4); border-radius: 4px; word-break: break-all;\\\">Websites --&gt; Zone --&gt; Caching --&gt; Configuration --&gt; Browser Cache TTL</code></p><p style=\\\"text-align: center;\\\"><img src=\\\":/014944930fec4038b2c0e7d81101a09e\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks: %7B%22align%22%3A%22center%22%7D; width: auto;\\\" width=\\\"auto\\\"/></p><h3 style=\\\"background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0 0; background-repeat: no-repeat; background-size: auto; border-style: none; border-width: 1px; border-color: rgb(0,0,0); border-radius: 0; height: auto; overflow: unset; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\\\"><span style=\\\"color: rgb(34, 34, 34); letter-spacing: 0em; border-style: none none none solid; border-width: 1px 1px 1px 3px; border-color: rgb(0, 0, 0) rgb(0, 0, 0) rgb(0, 0, 0) rgb(255, 177, 27); border-radius: 0px; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; display: block; font-weight: bold; height: auto; overflow: unset; text-indent: 0em; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\\\">Crawler Hints</span></h3><p style=\\\"color: rgb(58,58,58); letter-spacing: 0; text-indent: 0;\\\">爬虫提示。位于<code style=\\\"color: rgb(155, 110, 35); letter-spacing: 0em; background: none 0% 0% / auto no-repeat scroll padding-box border-box rgb(255, 245, 227); width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgb(0, 0, 0) rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.4); border-radius: 4px; word-break: break-all;\\\">Websites --&gt; Zone --&gt; Caching --&gt; Configuration --&gt; Crawler Hints</code>开启该功能后Cloudflare会提供高质量的网站信息给爬虫（例如搜索引擎爬虫），<strong style=\\\"color: rgb(0, 0, 0); background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px;\\\">建议打开</strong></p><p style=\\\"text-align: center;\\\"><img src=\\\":/2b1e7d02713c4f80b2c88da8eed25d38\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks: %7B%22align%22%3A%22center%22%7D; width: auto;\\\" width=\\\"auto\\\"/></p><h3 style=\\\"background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0 0; background-repeat: no-repeat; background-size: auto; border-style: none; border-width: 1px; border-color: rgb(0,0,0); border-radius: 0; height: auto; overflow: unset; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\\\"><span style=\\\"color: rgb(34, 34, 34); letter-spacing: 0em; border-style: none none none solid; border-width: 1px 1px 1px 3px; border-color: rgb(0, 0, 0) rgb(0, 0, 0) rgb(0, 0, 0) rgb(255, 177, 27); border-radius: 0px; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; display: block; font-weight: bold; height: auto; overflow: unset; text-indent: 0em; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\\\">Always Online™</span></h3><p style=\\\"color: rgb(58,58,58); letter-spacing: 0; text-indent: 0;\\\">永远在线。位于<code style=\\\"color: rgb(155, 110, 35); letter-spacing: 0em; background: none 0% 0% / auto no-repeat scroll padding-box border-box rgb(255, 245, 227); width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgb(0, 0, 0) rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.4); border-radius: 4px; word-break: break-all;\\\">Websites --&gt; Zone --&gt; Caching --&gt; Configuration --&gt; Always Online™</code>当你的源站挂掉的时候，Cloudflare 提供互联网档案 Wayback Machine 上的网页副本。<strong style=\\\"color: rgb(0, 0, 0); background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px;\\\">建议打开</strong></p><p style=\\\"text-align: center;\\\"><img src=\\\":/ee32572c4fb64840a060824d20b6192b\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks: %7B%22align%22%3A%22center%22%7D; width: auto;\\\" width=\\\"auto\\\"/></p><h3 style=\\\"background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0 0; background-repeat: no-repeat; background-size: auto; border-style: none; border-width: 1px; border-color: rgb(0,0,0); border-radius: 0; height: auto; overflow: unset; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\\\"><span style=\\\"color: rgb(34, 34, 34); letter-spacing: 0em; border-style: none none none solid; border-width: 1px 1px 1px 3px; border-color: rgb(0, 0, 0) rgb(0, 0, 0) rgb(0, 0, 0) rgb(255, 177, 27); border-radius: 0px; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; display: block; font-weight: bold; height: auto; overflow: unset; text-indent: 0em; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\\\">Tiered Cache</span></h3><p style=\\\"color: rgb(58,58,58); letter-spacing: 0; text-indent: 0;\\\">这是影响你网站访问速度的<strong style=\\\"color: rgb(0, 0, 0); background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px;\\\">关键设置</strong>，但是Cloudflare是<strong style=\\\"color: rgb(0, 0, 0); background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px;\\\">默认关闭</strong>的，一定要打开这个配置。位于<code style=\\\"color: rgb(155, 110, 35); letter-spacing: 0em; background: none 0% 0% / auto no-repeat scroll padding-box border-box rgb(255, 245, 227); width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgb(0, 0, 0) rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.4); border-radius: 4px; word-break: break-all;\\\">Websites --&gt; Zone --&gt; Caching --&gt; Tiered Cache</code>原理是Cloudflare将缓存资源进行了分层，当请求到达Cloudflare 任意CDN节点时，会以最快的方式从内部网络获取缓存资源，如果不打开该开关，可能某次请求CDN节点没有命中缓存的话，那么该节点就会去回源，用户体验就差了一大截</p><p style=\\\"text-align: center;\\\"><img src=\\\":/c43fe50bc6a24baf822341af96b6791b\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks: %7B%22align%22%3A%22center%22%7D; width: auto;\\\" width=\\\"auto\\\"/></p><h3 style=\\\"background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0 0; background-repeat: no-repeat; background-size: auto; border-style: none; border-width: 1px; border-color: rgb(0,0,0); border-radius: 0; height: auto; overflow: unset; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\\\"><span style=\\\"color: rgb(34, 34, 34); letter-spacing: 0em; border-style: none none none solid; border-width: 1px 1px 1px 3px; border-color: rgb(0, 0, 0) rgb(0, 0, 0) rgb(0, 0, 0) rgb(255, 177, 27); border-radius: 0px; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; display: block; font-weight: bold; height: auto; overflow: unset; text-indent: 0em; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\\\">Cache Reserve</span></h3><p style=\\\"color: rgb(58,58,58); letter-spacing: 0; text-indent: 0;\\\">这是一个按量付费的功能。Cache Reserve 是一个建立在 R2 之上的持久的数据存储服务，将网站的可缓存内容写入 Cache Reserve，作为缓存层级中的最高层，确保内容更长时间从缓存中提供，减少源服务器的负担和不必要的流量费用，架构图如下</p><p style=\\\"text-align: center;\\\"><img src=\\\":/9128c402fb6d4b169aeee99dd84f50b6\\\" type=\\\"image/jpeg\\\" data-filename=\\\"640.jpg\\\" style=\\\"--en-marks: %7B%22align%22%3A%22center%22%7D; width: auto;\\\" width=\\\"auto\\\"/></p><p style=\\\"color: rgb(58,58,58); letter-spacing: 0; text-indent: 0;\\\">在<code style=\\\"color: rgb(155, 110, 35); letter-spacing: 0em; background: none 0% 0% / auto no-repeat scroll padding-box border-box rgb(255, 245, 227); width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgb(0, 0, 0) rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.4); border-radius: 4px; word-break: break-all;\\\">Websites --&gt; Zone --&gt; Caching --&gt; Cache Reserve</code>就能一键打开，博主因为没用过所以这里不再多说，感兴趣的朋友试一下</p><p style=\\\"text-align: center;\\\"><img src=\\\":/27926892268a48a3b08717c7ff6e0b96\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks: %7B%22align%22%3A%22center%22%7D; width: auto;\\\" width=\\\"auto\\\"/></p><h2 style=\\\"background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0 0; background-repeat: no-repeat; background-size: auto; border-style: none; border-width: 1px; border-color: rgb(0,0,0); border-radius: 0; height: auto; overflow: unset; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\\\"><span style=\\\"font-size: 22px; color: rgb(81, 81, 81); letter-spacing: 0em; background-attachment: scroll; background-clip: border-box; background-image: linear-gradient(0deg, rgb(255, 177, 27) 40%, transparent 40%); background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 1px; border-color: rgb(0, 0, 0); border-radius: 0px; display: block; font-weight: bold; overflow: unset; text-indent: 0em; text-shadow: none; transform: none; -webkit-box-reflect: unset;\\\">🧑‍🏫 Cache Rules详解</span></h2><p style=\\\"color: rgb(58,58,58); letter-spacing: 0; text-indent: 0;\\\">除了打开上面介绍的各种配置的开关，还要进行相应的Cache Rules设置才能更好地缓存你的网站内容。免费计划里每个域名只能设置<code style=\\\"color: rgb(155, 110, 35); letter-spacing: 0em; background: none 0% 0% / auto no-repeat scroll padding-box border-box rgb(255, 245, 227); width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgb(0, 0, 0) rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.4); border-radius: 4px; word-break: break-all;\\\">10条规则</code>，而且是所有子域名也共用这10条规则。</p><h3 style=\\\"background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0 0; background-repeat: no-repeat; background-size: auto; border-style: none; border-width: 1px; border-color: rgb(0,0,0); border-radius: 0; height: auto; overflow: unset; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\\\"><span style=\\\"color: rgb(34, 34, 34); letter-spacing: 0em; border-style: none none none solid; border-width: 1px 1px 1px 3px; border-color: rgb(0, 0, 0) rgb(0, 0, 0) rgb(0, 0, 0) rgb(255, 177, 27); border-radius: 0px; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; display: block; font-weight: bold; height: auto; overflow: unset; text-indent: 0em; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\\\">默认缓存行为</span></h3><p style=\\\"color: rgb(58,58,58); letter-spacing: 0; text-indent: 0;\\\">当你把域名迁移到Cloudflare上，打开小黄云代理就可以使用Cloudflare CDN了，那么默认缓存了哪些资源呢？</p><p style=\\\"color: rgb(58,58,58); letter-spacing: 0; text-indent: 0;\\\">Cloudflare会根据你源站Http Header的值决定是否缓存该资源，满足以下条件该资源<strong style=\\\"color: rgb(0, 0, 0); background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px;\\\">不会被缓存</strong></p><ul style=\\\"\\\"><li><div style=\\\"color: rgb(58, 58, 58); letter-spacing: 0em;\\\">Cache-Control设置了 private, no-store, no-cache, or max-age=0.</div></li><li><div style=\\\"color: rgb(58, 58, 58); letter-spacing: 0em;\\\">存在 Set-Cookie 字段</div></li><li><div style=\\\"color: rgb(58, 58, 58); letter-spacing: 0em;\\\">非HTTP Get请求</div></li></ul><p style=\\\"color: rgb(58,58,58); letter-spacing: 0; text-indent: 0;\\\">满足以下条件，资源<strong style=\\\"color: rgb(0, 0, 0); background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px;\\\">会被缓存</strong></p><ul style=\\\"\\\"><li><div style=\\\"color: rgb(58, 58, 58); letter-spacing: 0em;\\\">Cache-Control 设置成了public 且max-age 大于0</div></li><li><div style=\\\"color: rgb(58, 58, 58); letter-spacing: 0em;\\\">设置了 Expires 字段且日期是未来的时间</div></li></ul><p style=\\\"color: rgb(58,58,58); letter-spacing: 0; text-indent: 0;\\\">Cloudflare 仅根据文件扩展名进行缓存，而不根据 MIME 类型进行缓存。默认情况下，Cloudflare CDN <strong style=\\\"color: rgb(0, 0, 0); background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px;\\\">不缓存 HTML 或 JSON</strong>，但会缓存网站的 <strong style=\\\"color: rgb(0, 0, 0); background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px;\\\">robots.txt</strong>。默认支持以下的拓展类型</p><div style=\\\"border-radius: 5px;\\\"><div style=\\\"--en-codeblock: true; --en-meta: {&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true}; box-sizing: border-box; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial;\\\"><pre><span>7Z CSV GIF MIDI PNG TIF ZIP</span><br/><span>AVI DOC GZ MKV PPT TIFF ZST</span><br/><span>AVIF DOCX ICO MP3 PPTX TTF </span><br/><span>APK DMG ISO MP4 PS WEBM </span><br/><span>BIN EJS JAR OGG RAR WEBP </span><br/><span>BMP EOT JPG OTF SVG WOFF </span><br/><span>BZ2 EPS JPEG PDF SVGZ WOFF2 </span><br/><span>CLASS EXE JS PICT SWF XLS </span><br/><span>CSS FLAC MID PLS TAR XLSX </span><br/></pre></div></div><p style=\\\"color: rgb(58,58,58); letter-spacing: 0; text-indent: 0;\\\">可以说基本支持绝大多数格式的文件，如果你有特别格式的文件要缓存，就要靠下面的Cache Rules设置</p><h3 style=\\\"background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0 0; background-repeat: no-repeat; background-size: auto; border-style: none; border-width: 1px; border-color: rgb(0,0,0); border-radius: 0; height: auto; overflow: unset; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\\\"><span style=\\\"color: rgb(34, 34, 34); letter-spacing: 0em; border-style: none none none solid; border-width: 1px 1px 1px 3px; border-color: rgb(0, 0, 0) rgb(0, 0, 0) rgb(0, 0, 0) rgb(255, 177, 27); border-radius: 0px; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; display: block; font-weight: bold; height: auto; overflow: unset; text-indent: 0em; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\\\">规则设置</span></h3><p style=\\\"color: rgb(58,58,58); letter-spacing: 0; text-indent: 0;\\\">这是关键的配置，位于<code style=\\\"color: rgb(155, 110, 35); letter-spacing: 0em; background: none 0% 0% / auto no-repeat scroll padding-box border-box rgb(255, 245, 227); width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgb(0, 0, 0) rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.4); border-radius: 4px; word-break: break-all;\\\">Websites --&gt; Zone --&gt; Caching --&gt; Cache Rules</code></p><p style=\\\"text-align: center;\\\"><img src=\\\":/c99e702b82344b43a9c19a325c47a4d3\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks: %7B%22align%22%3A%22center%22%7D; width: auto;\\\" width=\\\"auto\\\"/></p><p style=\\\"color: rgb(58,58,58); letter-spacing: 0; text-indent: 0;\\\">一般我们的网站由<code style=\\\"color: rgb(155, 110, 35); letter-spacing: 0em; background: none 0% 0% / auto no-repeat scroll padding-box border-box rgb(255, 245, 227); width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgb(0, 0, 0) rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.4); border-radius: 4px; word-break: break-all;\\\">静态资源 + 动态的api数据</code>组成，设置Cache Rules的目标是让静态资源都能命中，动态资源则让CDN放行，这里抛砖引玉给大家介绍两条规则，具体要根据自己网站的情况调整。</p><h4 style=\\\"\\\"><span style=\\\"letter-spacing: 0em; font-weight: bold; display: block;\\\">缓存html页面</span></h4><p style=\\\"color: rgb(58,58,58); letter-spacing: 0; text-indent: 0;\\\">Cloudflare默认是不缓存html页面的，我们可以通过设置进行缓存。点击<code style=\\\"color: rgb(155, 110, 35); letter-spacing: 0em; background: none 0% 0% / auto no-repeat scroll padding-box border-box rgb(255, 245, 227); width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgb(0, 0, 0) rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.4); border-radius: 4px; word-break: break-all;\\\">Create Rule</code>按钮后进入到设置页面。</p><p style=\\\"text-align: center;\\\"><img src=\\\":/6eaf877cab5849a8957ac8fdc693ca76\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks: %7B%22align%22%3A%22center%22%7D; width: auto;\\\" width=\\\"auto\\\"/></p><p style=\\\"color: rgb(58,58,58); letter-spacing: 0; text-indent: 0;\\\">这里特别说明一下两个参数，<code style=\\\"color: rgb(155, 110, 35); letter-spacing: 0em; background: none 0% 0% / auto no-repeat scroll padding-box border-box rgb(255, 245, 227); width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgb(0, 0, 0) rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.4); border-radius: 4px; word-break: break-all;\\\">Edge TTL</code>和<code style=\\\"color: rgb(155, 110, 35); letter-spacing: 0em; background: none 0% 0% / auto no-repeat scroll padding-box border-box rgb(255, 245, 227); width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgb(0, 0, 0) rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.4); border-radius: 4px; word-break: break-all;\\\">Brower TTL</code>。TTL(Time To Live)指缓存留存时间，<code style=\\\"color: rgb(155, 110, 35); letter-spacing: 0em; background: none 0% 0% / auto no-repeat scroll padding-box border-box rgb(255, 245, 227); width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgb(0, 0, 0) rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.4); border-radius: 4px; word-break: break-all;\\\">Edge TTL</code>指CDN节点缓存资源的时长，<code style=\\\"color: rgb(155, 110, 35); letter-spacing: 0em; background: none 0% 0% / auto no-repeat scroll padding-box border-box rgb(255, 245, 227); width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgb(0, 0, 0) rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.4); border-radius: 4px; word-break: break-all;\\\">Brower TTL</code>指浏览器缓存资源的时长，具体设置看你网站更新频率，一般<code style=\\\"color: rgb(155, 110, 35); letter-spacing: 0em; background: none 0% 0% / auto no-repeat scroll padding-box border-box rgb(255, 245, 227); width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgb(0, 0, 0) rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.4); border-radius: 4px; word-break: break-all;\\\">Brower TTL</code>设得比<code style=\\\"color: rgb(155, 110, 35); letter-spacing: 0em; background: none 0% 0% / auto no-repeat scroll padding-box border-box rgb(255, 245, 227); width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgb(0, 0, 0) rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.4); border-radius: 4px; word-break: break-all;\\\">Edge TTL</code>小</p><h4 style=\\\"\\\"><span style=\\\"letter-spacing: 0em; font-weight: bold; display: block;\\\">放行后端接口请求</span></h4><p style=\\\"color: rgb(58,58,58); letter-spacing: 0; text-indent: 0;\\\">接着我们再设置一条规则直接放行访问后端api接口的请求</p><p style=\\\"text-align: center;\\\"><img src=\\\":/a8a7890ae8bb490c8502026b42181f0d\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks: %7B%22align%22%3A%22center%22%7D; width: auto;\\\" width=\\\"auto\\\"/></p><h2 style=\\\"background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0 0; background-repeat: no-repeat; background-size: auto; border-style: none; border-width: 1px; border-color: rgb(0,0,0); border-radius: 0; height: auto; overflow: unset; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\\\"><span style=\\\"font-size: 22px; color: rgb(81, 81, 81); letter-spacing: 0em; background-attachment: scroll; background-clip: border-box; background-image: linear-gradient(0deg, rgb(255, 177, 27) 40%, transparent 40%); background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 1px; border-color: rgb(0, 0, 0); border-radius: 0px; display: block; font-weight: bold; overflow: unset; text-indent: 0em; text-shadow: none; transform: none; -webkit-box-reflect: unset;\\\">☑︎ 验证缓存是否生效</span></h2><p style=\\\"color: rgb(58,58,58); letter-spacing: 0; text-indent: 0;\\\">打开了各种配置的开关和设置了Cache Rule，接下来就要验证缓存是否生效。</p><p style=\\\"text-align: center;\\\"><img src=\\\":/bdfaa6139d2147619f87070bc35ec7d9\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks: %7B%22align%22%3A%22center%22%7D; width: auto;\\\" width=\\\"auto\\\"/></p><p style=\\\"color: rgb(58,58,58); letter-spacing: 0; text-indent: 0;\\\"><span style=\\\"letter-spacing: 0em; text-indent: 0em; word-spacing: 0em;\\\">访问你的网站，例如：</span><span style=\\\"letter-spacing: 0em; text-indent: 0em; word-spacing: 0em;\\\">yourdomain.com，如果你的网站用了Cloudflare CDN，Cloudflare会在响应的报文头里添加一个</span><code style=\\\"letter-spacing: 0em; text-indent: 0em; word-spacing: 0em; color: rgb(155, 110, 35); background: none 0% 0% / auto no-repeat scroll padding-box border-box rgb(255, 245, 227); width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgb(0, 0, 0) rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.4); border-radius: 4px; word-break: break-all;\\\">cf-cache-status</code><span style=\\\"letter-spacing: 0em; text-indent: 0em; word-spacing: 0em;\\\">字段用于标识该资源是否命中了缓存，这个字段一共有以下状态：</span></p><ul style=\\\"\\\"><li><div style=\\\"color: rgb(58, 58, 58); letter-spacing: 0em;\\\"><strong style=\\\"color: rgb(0, 0, 0); background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px;\\\">HIT</strong>：命中缓存</div></li><li><div style=\\\"color: rgb(58, 58, 58); letter-spacing: 0em;\\\"><strong style=\\\"color: rgb(0, 0, 0); background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px;\\\">MISS</strong>: 没有命中缓存，该资源从源服务器获取</div></li><li><div style=\\\"color: rgb(58, 58, 58); letter-spacing: 0em;\\\"><strong style=\\\"color: rgb(0, 0, 0); background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px;\\\">NONE/UNKNOWN</strong>: Cloudflare 生成的响应表明该资源不符合缓存条件。这可能是以下的几种情况导致的</div></li><ul style=\\\"list-style-type: square; color: rgb(0,0,0);\\\"><li><div style=\\\"color: rgb(58, 58, 58); letter-spacing: 0em;\\\"><strong style=\\\"color: rgb(0, 0, 0); background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px;\\\">Worker 直接生成响应，未发送任何子请求。</strong>在这种情况下，响应并非来自缓存，因此缓存状态将为NONE/UNKNOWN。</div></li><li><div style=\\\"color: rgb(58, 58, 58); letter-spacing: 0em;\\\"><strong style=\\\"color: rgb(0, 0, 0); background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px;\\\">Worker 请求发起了子请求 (fetch)。</strong>在这种情况下，子请求将记录其缓存状态，而主请求将记录为NONE/UNKNOWN（主请求未命中缓存，因为 Worker 位于缓存之前）。</div></li><li><div style=\\\"color: rgb(58, 58, 58); letter-spacing: 0em;\\\"><strong style=\\\"color: rgb(0, 0, 0); background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px;\\\">触发了 WAF 自定义规则来阻止请求。</strong>在到达缓存之前，由于没有缓存状态，Cloudflare 将记录为NONE/UNKNOWN。</div></li><li><div style=\\\"color: rgb(58, 58, 58); letter-spacing: 0em;\\\">重定向规则或始终使用 HTTPS 导致全球网络返回重定向到另一个资源/URL 的响应。</div></li></ul><li><div style=\\\"color: rgb(58, 58, 58); letter-spacing: 0em;\\\"><strong style=\\\"color: rgb(0, 0, 0); background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px;\\\">EXPIRED</strong>：在CDN中发现缓存，但是过期了，该资源从源服务器获取</div></li><li><div style=\\\"color: rgb(58, 58, 58); letter-spacing: 0em;\\\"><strong style=\\\"color: rgb(0, 0, 0); background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px;\\\">STALE</strong>：在CDN中发现缓存，但是过期了且该资源无法从源服务器获取</div></li><li><div style=\\\"color: rgb(58, 58, 58); letter-spacing: 0em;\\\"><strong style=\\\"color: rgb(0, 0, 0); background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px;\\\">BYPASS</strong>：Cache Rule里面设置的BYPASS规则</div></li><li><div style=\\\"color: rgb(58, 58, 58); letter-spacing: 0em;\\\"><strong style=\\\"color: rgb(0, 0, 0); background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px;\\\">REVALIDATED</strong>：该资源由 Cloudflare 的缓存提供，但已过期。该资源已通过 If-Modified-Since 标头或 If-None-Match 标头重新验证。</div></li><li><div style=\\\"color: rgb(58, 58, 58); letter-spacing: 0em;\\\"><strong style=\\\"color: rgb(0, 0, 0); background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px;\\\">UPDATING</strong>:该资源由 Cloudflare 的缓存提供，已过期，但源 Web 服务器正在更新该资源。通常只有访问量特别大的缓存资源同时缓存失效时才会触发该状态。</div></li><li><div style=\\\"color: rgb(58, 58, 58); letter-spacing: 0em;\\\"><strong style=\\\"color: rgb(0, 0, 0); background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px;\\\">DYNAMIC</strong>：Cloudflare 认为该资产不适合缓存，并且你为设置Cache Rule指示 Cloudflare 缓存该资产。该资产是从源 Web 服务器请求的。</div></li></ul><p style=\\\"color: rgb(58,58,58); letter-spacing: 0; text-indent: 0;\\\">只要你设置得当，你在Cloudflare的后台管理面板里就能看到网站的Percent Cached在不断提高，用户访问网站的体验也会更好</p><p style=\\\"text-align: center;\\\"><img src=\\\":/509a4e3e6395428698a1e409e35c20ef\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks: %7B%22align%22%3A%22center%22%7D; width: auto;\\\" width=\\\"auto\\\"/></p><h2 style=\\\"background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0 0; background-repeat: no-repeat; background-size: auto; border-style: none; border-width: 1px; border-color: rgb(0,0,0); border-radius: 0; height: auto; overflow: unset; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\\\"><span style=\\\"font-size: 22px; color: rgb(81, 81, 81); letter-spacing: 0em; background-attachment: scroll; background-clip: border-box; background-image: linear-gradient(0deg, rgb(255, 177, 27) 40%, transparent 40%); background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 1px; border-color: rgb(0, 0, 0); border-radius: 0px; display: block; font-weight: bold; overflow: unset; text-indent: 0em; text-shadow: none; transform: none; -webkit-box-reflect: unset;\\\">📝 总结</span></h2><p style=\\\"color: rgb(58,58,58); letter-spacing: 0; text-indent: 0;\\\">许多境内朋友反馈用了Cloudflare的CDN后“反向加速”，除了境内网络线路问题，更大的可能是Cache没设置好，关键以下两点设置：</p><ul style=\\\"\\\"><li><div style=\\\"color: rgb(58, 58, 58); letter-spacing: 0em;\\\">打开Tiered cache，<strong style=\\\"color: rgb(0, 0, 0); background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px;\\\">默认是关闭</strong>的。该配置可以减少回源</div></li><li><div style=\\\"color: rgb(58, 58, 58); letter-spacing: 0em;\\\">设置Cache Rule ，定制你自己的缓存规则</div></li></ul><p style=\\\"color: rgb(58,58,58); letter-spacing: 0; text-indent: 0;\\\">这样可以让绝大多数静态资源都缓存到Cloudflare CDN中，同时访问后端接口时不访问CDN而是直接回源。</p><h2 style=\\\"background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0 0; background-repeat: no-repeat; background-size: auto; border-style: none; border-width: 1px; border-color: rgb(0,0,0); border-radius: 0; height: auto; overflow: unset; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\\\"><span style=\\\"font-size: 22px; color: rgb(81, 81, 81); letter-spacing: 0em; background-attachment: scroll; background-clip: border-box; background-image: linear-gradient(0deg, rgb(255, 177, 27) 40%, transparent 40%); background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 1px; border-color: rgb(0, 0, 0); border-radius: 0px; display: block; font-weight: bold; overflow: unset; text-indent: 0em; text-shadow: none; transform: none; -webkit-box-reflect: unset;\\\">💭 后记</span></h2><p style=\\\"color: rgb(58,58,58); letter-spacing: 0; text-indent: 0;\\\">本文只介绍了Cloudflare Cache最基本的用法，如果结合Worker使用会变得更复杂，后续有使用场景再做具体介绍</p></div><p style=\\\"\\\"><br/></p></div></div><div><div><div><div style=\\\"display: flex;\\\"><div style=\\\"color: rgba(0,0,0,.3);\\\"><span>修改于</span></div></div></div></div></div></div></div></div></span>\\\n</div></body></html>\\u0000\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":47333}]"
metadata_diff: {"new":{"id":"ebfba8391530426eb6a0c980613a3edc","parent_id":"f67288c3a0be4374b5d532b5dcc3aabc","latitude":"0.00000000","longitude":"0.00000000","altitude":"0.0000","author":"","source_url":"","is_todo":0,"todo_due":0,"todo_completed":0,"source":"joplin-desktop","source_application":"net.cozic.joplin-desktop","application_data":"","order":1764348817652,"markup_language":2,"is_shared":0,"share_id":"","conflict_original_id":"","master_key_id":"","user_data":"","deleted_time":0},"deleted":[]}
encryption_cipher_text: 
encryption_applied: 0
updated_time: 2025-11-28T21:03:21.719Z
created_time: 2025-11-28T21:03:21.719Z
type_: 13