{"id":442715,"date":"2026-06-18T17:31:54","date_gmt":"2026-06-18T09:31:54","guid":{"rendered":"https:\/\/idc.net\/help\/?p=442715"},"modified":"2026-06-11T17:33:36","modified_gmt":"2026-06-11T09:33:36","slug":"cdn%e5%8a%a0%e9%80%9f%e5%ae%8c%e6%95%b4%e9%83%a8%e7%bd%b2%e6%8c%87%e5%8d%97%ef%bc%9acloudflare-%e9%a6%99%e6%b8%af%e6%ba%90%e7%ab%99%e9%85%8d%e7%bd%ae%e3%80%81%e7%bc%93%e5%ad%98%e8%a7%84%e5%88%99","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/442715\/","title":{"rendered":"CDN\u52a0\u901f\u5b8c\u6574\u90e8\u7f72\u6307\u5357\uff1aCloudflare + \u9999\u6e2f\u6e90\u7ad9\u914d\u7f6e\u3001\u7f13\u5b58\u89c4\u5219\u4e0e\u56de\u6e90\u4f18\u5316"},"content":{"rendered":"<p>CDN\uff08\u5185\u5bb9\u5206\u53d1\u7f51\u7edc\uff09\u901a\u8fc7\u5c06\u9759\u6001\u8d44\u6e90\u7f13\u5b58\u5230\u5168\u7403\u8fb9\u7f18\u8282\u70b9\uff0c\u8ba9\u7528\u6237\u4ece\u8ddd\u79bb\u6700\u8fd1\u7684\u8282\u70b9\u83b7\u53d6\u5185\u5bb9\uff0c\u5927\u5e45\u964d\u4f4e\u5ef6\u8fdf\u548c\u6e90\u7ad9\u5e26\u5bbd\u538b\u529b\u3002Cloudflare\u662f\u76ee\u524d\u6700\u4e3b\u6d41\u7684CDN\u670d\u52a1\u5546\uff0c\u514d\u8d39\u7248\u529f\u80fd\u5df2\u8db3\u4ee5\u6ee1\u8db3\u5927\u591a\u6570\u7ad9\u957f\u9700\u6c42\u3002\u672c\u6587\u4ee5\u9999\u6e2f\u6e90\u7ad9\u4e3a\u4f8b\uff0c\u7ed9\u51fa\u5b8c\u6574\u7684\u90e8\u7f72\u548c\u914d\u7f6e\u65b9\u6848\u3002<\/p>\n<h2>\u4e00\u3001CDN\u7684\u6838\u5fc3\u4ef7\u503c<\/h2>\n<ul>\n<li><strong>\u5168\u7403\u52a0\u901f<\/strong>\uff1aCloudflare\u5728\u5168\u7403300+\u57ce\u5e02\u6709\u8282\u70b9\uff0c\u6b27\u7f8e\u7528\u6237\u8bbf\u95ee\u9999\u6e2f\u6e90\u7ad9\u7684\u9759\u6001\u8d44\u6e90\u65f6\uff0c\u5b9e\u9645\u4ece\u5f53\u5730\u8282\u70b9\u83b7\u53d6\uff0c\u5ef6\u8fdf\u4ece200ms\u964d\u81f320ms\u4ee5\u5185<\/li>\n<li><strong>\u9690\u85cf\u6e90\u7ad9IP<\/strong>\uff1a\u7528\u6237\u8bf7\u6c42\u5148\u5230\u8fbeCloudflare\uff0c\u771f\u5b9e\u670d\u52a1\u5668IP\u4e0d\u66b4\u9732\uff0c\u964d\u4f4e\u88ab\u76f4\u63a5\u653b\u51fb\u98ce\u9669<\/li>\n<li><strong>\u51cf\u5c11\u6e90\u7ad9\u5e26\u5bbd<\/strong>\uff1a\u9759\u6001\u8d44\u6e90\u7531CDN\u8282\u70b9\u63d0\u4f9b\uff0c\u6e90\u7ad9\u5e26\u5bbd\u6d88\u8017\u51cf\u5c1160%~80%<\/li>\n<li><strong>\u514d\u8d39DDoS\u9632\u62a4<\/strong>\uff1aCloudflare\u514d\u8d39\u7248\u63d0\u4f9b\u65e0\u9650DDoS\u6d41\u91cf\u6e05\u6d17<\/li>\n<li><strong>\u514d\u8d39SSL\u8bc1\u4e66<\/strong>\uff1a\u81ea\u52a8\u7b7e\u53d1\u548c\u7eed\u7b7e\uff0c\u65e0\u9700\u624b\u52a8\u64cd\u4f5c<\/li>\n<\/ul>\n<h2>\u4e8c\u3001Cloudflare\u63a5\u5165\u6d41\u7a0b<\/h2>\n<h3>\u7b2c\u4e00\u6b65\uff1a\u6ce8\u518c\u5e76\u6dfb\u52a0\u7ad9\u70b9<\/h3>\n<ol>\n<li>\u8bbf\u95ee cloudflare.com \u6ce8\u518c\u8d26\u53f7<\/li>\n<li>\u70b9\u51fb\u300cAdd a Site\u300d\uff0c\u8f93\u5165\u4f60\u7684\u57df\u540d<\/li>\n<li>\u9009\u62e9\u514d\u8d39\u5957\u9910\uff08Free Plan\uff09<\/li>\n<li>Cloudflare\u81ea\u52a8\u626b\u63cf\u73b0\u6709DNS\u8bb0\u5f55\uff0c\u786e\u8ba4\u65e0\u8bef\u540e\u7ee7\u7eed<\/li>\n<\/ol>\n<h3>\u7b2c\u4e8c\u6b65\uff1a\u4fee\u6539\u57df\u540dNS\u670d\u52a1\u5668<\/h3>\n<p>Cloudflare\u4f1a\u63d0\u4f9b\u4e24\u4e2aNS\u670d\u52a1\u5668\u5730\u5740\uff08\u5982 <code>aria.ns.cloudflare.com<\/code>\uff09\uff0c\u767b\u5f55\u4f60\u7684\u57df\u540d\u6ce8\u518c\u5546\uff0c\u5c06NS\u8bb0\u5f55\u66ff\u6362\u4e3aCloudflare\u63d0\u4f9b\u7684\u5730\u5740\u3002NS\u751f\u6548\u901a\u5e38\u9700\u89815~30\u5206\u949f\u3002<\/p>\n<h3>\u7b2c\u4e09\u6b65\uff1a\u914d\u7f6eDNS\u8bb0\u5f55\u4ee3\u7406\u72b6\u6001<\/h3>\n<p>\u5728Cloudflare DNS\u7ba1\u7406\u9875\u9762\uff1a<\/p>\n<ul>\n<li>\u9700\u8981CDN\u52a0\u901f\u7684\u8bb0\u5f55\uff08\u5982A\u8bb0\u5f55\u6307\u5411\u6e90\u7ad9IP\uff09\u2192 \u4ee3\u7406\u72b6\u6001\u8bbe\u4e3a\u300c\u5df2\u4ee3\u7406\u300d\uff08\u6a59\u8272\u4e91\u6735\u56fe\u6807\uff09<\/li>\n<li>\u4e0d\u9700\u8981CDN\u7684\u8bb0\u5f55\uff08\u5982\u90ae\u4ef6\u670d\u52a1\u5668MX\u3001API\u5b50\u57df\u540d\uff09\u2192 \u8bbe\u4e3a\u300c\u4ec5DNS\u300d\uff08\u7070\u8272\u4e91\u6735\uff09<\/li>\n<\/ul>\n<h2>\u4e09\u3001SSL\/TLS\u6a21\u5f0f\u914d\u7f6e<\/h2>\n<p>Cloudflare\u7684SSL\u6a21\u5f0f\u9009\u62e9\u975e\u5e38\u91cd\u8981\uff0c\u914d\u7f6e\u9519\u8bef\u4f1a\u5bfc\u81f4\u91cd\u5b9a\u5411\u5faa\u73af\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th>SSL\u6a21\u5f0f<\/th>\n<th>\u8bf4\u660e<\/th>\n<th>\u63a8\u8350\u573a\u666f<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u5173\u95ed<\/td>\n<td>HTTP\u660e\u6587\u4f20\u8f93\uff0c\u4e0d\u63a8\u8350<\/td>\n<td>\u4e0d\u63a8\u8350\u4f7f\u7528<\/td>\n<\/tr>\n<tr>\n<td>\u7075\u6d3b<\/td>\n<td>\u7528\u6237\u2192CF\u8d70HTTPS\uff0cCF\u2192\u6e90\u7ad9\u8d70HTTP<\/td>\n<td>\u6e90\u7ad9\u6ca1\u6709SSL\u8bc1\u4e66\u65f6\u7684\u4e34\u65f6\u65b9\u6848<\/td>\n<\/tr>\n<tr>\n<td>\u5b8c\u5168<\/td>\n<td>\u5168\u7a0bHTTPS\uff0c\u4f46\u4e0d\u9a8c\u8bc1\u6e90\u7ad9\u8bc1\u4e66<\/td>\n<td>\u6e90\u7ad9\u6709\u81ea\u7b7e\u540d\u8bc1\u4e66<\/td>\n<\/tr>\n<tr>\n<td>\u5b8c\u5168\uff08\u4e25\u683c\uff09<\/td>\n<td>\u5168\u7a0bHTTPS\uff0c\u9a8c\u8bc1\u6e90\u7ad9\u8bc1\u4e66\u6709\u6548\u6027<\/td>\n<td>\u63a8\u8350\uff0c\u5b89\u5168\u6027\u6700\u9ad8<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u63a8\u8350\u4f7f\u7528\u300c\u5b8c\u5168\uff08\u4e25\u683c\uff09\u300d\u6a21\u5f0f\uff1a\u6e90\u7ad9\u5b89\u88c5Let's Encrypt\u8bc1\u4e66 + Cloudflare\u5f00\u542f\u300c\u5b8c\u5168\u4e25\u683c\u300d\uff0c\u5b9e\u73b0\u7aef\u5230\u7aef\u52a0\u5bc6\u3002<\/p>\n<h2>\u56db\u3001\u7f13\u5b58\u89c4\u5219\u914d\u7f6e<\/h2>\n<h3>\u9ed8\u8ba4\u7f13\u5b58\u884c\u4e3a<\/h3>\n<p>Cloudflare\u9ed8\u8ba4\u7f13\u5b58\u4ee5\u4e0b\u6587\u4ef6\u7c7b\u578b\uff1acss\u3001js\u3001jpg\u3001jpeg\u3001png\u3001gif\u3001webp\u3001ico\u3001svg\u3001woff\u3001woff2\u7b49\u9759\u6001\u8d44\u6e90\u3002HTML\u9ed8\u8ba4\u4e0d\u7f13\u5b58\uff08\u56e0\u4e3a\u5305\u542b\u52a8\u6001\u5185\u5bb9\uff09\u3002<\/p>\n<h3>\u81ea\u5b9a\u4e49\u7f13\u5b58\u89c4\u5219\uff08Cache Rules\uff09<\/h3>\n<p>\u767b\u5f55Cloudflare\u63a7\u5236\u53f0 \u2192 \u7f13\u5b58 \u2192 \u7f13\u5b58\u89c4\u5219 \u2192 \u521b\u5efa\u89c4\u5219\uff1a<\/p>\n<p><strong>\u89c4\u52191\uff1aWordPress\u540e\u53f0\u4e0d\u7f13\u5b58<\/strong><\/p>\n<ul>\n<li>\u6761\u4ef6\uff1aURI\u8def\u5f84\u5305\u542b <code>\/wp-admin<\/code> \u6216 Cookie\u5305\u542b <code>wordpress_logged_in<\/code><\/li>\n<li>\u52a8\u4f5c\uff1a\u7ed5\u8fc7\u7f13\u5b58<\/li>\n<\/ul>\n<p><strong>\u89c4\u52192\uff1a\u9759\u6001\u8d44\u6e90\u957f\u671f\u7f13\u5b58<\/strong><\/p>\n<ul>\n<li>\u6761\u4ef6\uff1a\u6587\u4ef6\u6269\u5c55\u540d\u4e3a jpg, jpeg, png, gif, webp, css, js<\/li>\n<li>\u52a8\u4f5c\uff1a\u7f13\u5b58\u6240\u6709\u5185\u5bb9\uff0c\u8fb9\u7f18TTL\u8bbe\u4e3a1\u4e2a\u6708<\/li>\n<\/ul>\n<p><strong>\u89c4\u52193\uff1aHTML\u9875\u9762\u77ed\u671f\u7f13\u5b58<\/strong><\/p>\n<ul>\n<li>\u6761\u4ef6\uff1aURI\u8def\u5f84\u4e0d\u5305\u542b\u7279\u6b8a\u8def\u5f84\uff0cContent-Type\u4e3aHTML<\/li>\n<li>\u52a8\u4f5c\uff1a\u7f13\u5b58\uff0c\u8fb9\u7f18TTL\u8bbe\u4e3a4\u5c0f\u65f6<\/li>\n<\/ul>\n<h2>\u4e94\u3001\u6e90\u7ad9\u4f18\u5316\u914d\u7f6e<\/h2>\n<h3>\u5f00\u542fHTTP\/2 Push\uff08\u53ef\u9009\uff09<\/h3>\n<p>Cloudflare \u2192 \u901f\u5ea6 \u2192 \u4f18\u5316 \u2192 \u5f00\u542f HTTP\/2 Push\uff0c\u670d\u52a1\u5668\u53ef\u4e3b\u52a8\u5c06\u5173\u952e\u8d44\u6e90\u63a8\u9001\u7ed9\u5ba2\u6237\u7aef\uff0c\u51cf\u5c11\u8bf7\u6c42\u5f80\u8fd4\u6b21\u6570\u3002<\/p>\n<h3>\u5f00\u542fBrotli\u538b\u7f29<\/h3>\n<p>Cloudflare \u2192 \u901f\u5ea6 \u2192 \u4f18\u5316 \u2192 \u5f00\u542f Brotli\uff0cBrotli\u538b\u7f29\u6bd4Gzip\u5e73\u5747\u9ad815%~20%\uff0c\u5bf9\u6587\u672c\u8d44\u6e90\u6548\u679c\u663e\u8457\u3002<\/p>\n<h3>Rocket Loader\uff08\u8c28\u614e\u4f7f\u7528\uff09<\/h3>\n<p>Cloudflare\u7684Rocket Loader\u53ef\u5f02\u6b65\u52a0\u8f7dJavaScript\uff0c\u4f46\u53ef\u80fd\u4e0e\u67d0\u4e9b\u63d2\u4ef6\u51b2\u7a81\u3002\u5efa\u8bae\u5148\u5728\u6d4b\u8bd5\u73af\u5883\u9a8c\u8bc1\u3002<\/p>\n<h2>\u516d\u3001\u6e90\u7ad9Nginx\u914d\u7f6e\u4e0eCloudflare\u534f\u4f5c<\/h2>\n<pre><code>server {\r\n    listen 443 ssl http2;\r\n    server_name \u4f60\u7684\u57df\u540d;\r\n\r\n    # \u53ea\u5141\u8bb8Cloudflare IP\u6bb5\u8bbf\u95ee\uff08\u9632\u6b62\u7ed5\u8fc7CDN\u76f4\u63a5\u653b\u51fb\u6e90\u7ad9\uff09\r\n    # Cloudflare IPv4\u6bb5\uff08\u5b9a\u671f\u66f4\u65b0\uff09\r\n    allow 173.245.48.0\/20;\r\n    allow 103.21.244.0\/22;\r\n    allow 103.22.200.0\/22;\r\n    allow 103.31.4.0\/22;\r\n    allow 141.101.64.0\/18;\r\n    allow 108.162.192.0\/18;\r\n    allow 190.93.240.0\/20;\r\n    allow 188.114.96.0\/20;\r\n    allow 197.234.240.0\/22;\r\n    allow 198.41.128.0\/17;\r\n    allow 162.158.0.0\/15;\r\n    allow 104.16.0.0\/13;\r\n    allow 104.24.0.0\/14;\r\n    allow 172.64.0.0\/13;\r\n    allow 131.0.72.0\/22;\r\n    deny all;\r\n\r\n    # \u83b7\u53d6\u771f\u5b9e\u8bbf\u5ba2IP\uff08Cloudflare\u4ee3\u7406\u540eIP\u53d8\u4e3aCF\u8282\u70b9IP\uff09\r\n    set_real_ip_from 103.21.244.0\/22;\r\n    set_real_ip_from 173.245.48.0\/20;\r\n    real_ip_header CF-Connecting-IP;\r\n}<\/code><\/pre>\n<h2>\u4e03\u3001\u6027\u80fd\u9a8c\u8bc1<\/h2>\n<pre><code># \u68c0\u67e5\u54cd\u5e94\u5934\u4e2d\u7684\u7f13\u5b58\u72b6\u6001\r\ncurl -I https:\/\/\u4f60\u7684\u57df\u540d\/style.css | grep -E \"CF-Cache-Status|Cache-Control|Age\"\r\n\r\n# CF-Cache-Status\u8bf4\u660e\uff1a\r\n# HIT   \u2014 \u4eceCloudflare\u7f13\u5b58\u8fd4\u56de\uff08\u7406\u60f3\u72b6\u6001\uff09\r\n# MISS  \u2014 \u672a\u547d\u4e2d\u7f13\u5b58\uff0c\u56de\u6e90\u62c9\u53d6\r\n# BYPASS\u2014 \u7f13\u5b58\u88ab\u89c4\u5219\u8df3\u8fc7\r\n# EXPIRED\u2014 \u7f13\u5b58\u5df2\u8fc7\u671f\uff0c\u91cd\u65b0\u56de\u6e90<\/code><\/pre>\n<h2>\u516b\u3001\u603b\u7ed3<\/h2>\n<p>Cloudflare\u514d\u8d39\u7248\u914d\u5408\u9999\u6e2f\u6e90\u7ad9\uff0c\u662f\u76ee\u524d\u6027\u4ef7\u6bd4\u6700\u9ad8\u7684\u5168\u7403CDN\u52a0\u901f\u65b9\u6848\u3002\u6b63\u786e\u914d\u7f6e\u540e\uff0c\u6b27\u7f8e\u7528\u6237\u8bbf\u95ee\u5ef6\u8fdf\u53ef\u964d\u4f4e80%\u4ee5\u4e0a\uff0c\u6e90\u7ad9\u5e26\u5bbd\u53ef\u8282\u770160%\u4ee5\u4e0a\u3002IDC.Net\u7684<a href=\"https:\/\/idc.net\/cloud-hk\/\">\u9999\u6e2f\u670d\u52a1\u5668<\/a>\u5b8c\u5168\u517c\u5bb9Cloudflare CDN\u63a5\u5165\uff0c\u5f00\u7bb1\u5373\u7528\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CDN\uff08\u5185\u5bb9\u5206\u53d1\u7f51\u7edc\uff09\u901a\u8fc7\u5c06\u9759\u6001\u8d44\u6e90\u7f13\u5b58\u5230\u5168\u7403\u8fb9\u7f18\u8282\u70b9\uff0c\u8ba9\u7528\u6237\u4ece\u8ddd\u79bb\u6700\u8fd1\u7684\u8282\u70b9\u83b7\u53d6\u5185\u5bb9\uff0c\u5927\u5e45\u964d\u4f4e\u5ef6\u8fdf\u548c\u6e90\u7ad9\u5e26\u5bbd [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[],"class_list":["post-442715","post","type-post","status-publish","format-standard","hentry","category-cdn"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/442715","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=442715"}],"version-history":[{"count":1,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/442715\/revisions"}],"predecessor-version":[{"id":442716,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/442715\/revisions\/442716"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=442715"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=442715"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=442715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}