{"id":1489,"date":"2026-09-03T12:16:59","date_gmt":"2026-09-03T06:46:59","guid":{"rendered":"https:\/\/cpanelfree.com\/blog\/how-to-configure-cloudflare-page-rules-cache-everything-wordpress\/"},"modified":"2026-09-03T12:31:07","modified_gmt":"2026-09-03T07:01:07","slug":"how-to-configure-cloudflare-page-rules-cache-everything-wordpress","status":"publish","type":"post","link":"https:\/\/cpanelfree.com\/blog\/how-to-configure-cloudflare-page-rules-cache-everything-wordpress\/","title":{"rendered":"How to Configure Cloudflare Page Rules &amp; Cache Everything for WordPress"},"content":{"rendered":"<div style=\"background-color: #f8fafc;border-left: 4px solid #a855f7;padding: 20px;border-radius: 6px;margin-bottom: 25px\">\n<p style=\"margin: 0;font-size: 16px;color: #1e293b\">\n        <strong>Quick Answer:<\/strong> By default, Cloudflare only caches static files (images, CSS, JS) and passes all HTML requests to your origin server. Configuring <strong>&#8220;Cache Everything&#8221; Page Rules \/ Cache Rules<\/strong> caches the entire generated HTML page across Cloudflare&#8217;s 300+ edge data centers, delivering instant <strong>sub-30ms TTFB worldwide<\/strong> while safely bypassing the cache for logged-in administrators and WooCommerce cart sessions.\n    <\/p>\n<\/div>\n<h2>Why Default Cloudflare Does Not Cache WordPress HTML<\/h2>\n<p>Cloudflare&#8217;s standard caching configuration only caches assets matching specific static file extensions (<code>.jpg<\/code>, <code>.css<\/code>, <code>.js<\/code>, <code>.webp<\/code>). Because WordPress generates dynamic HTML pages via PHP and MySQL, Cloudflare forwards every page request to your origin web server.<\/p>\n<p>Enabling <strong>Cache Everything<\/strong> turns Cloudflare into a global edge page cache, allowing your website to handle tens of thousands of concurrent visitors on a free shared hosting account without crashing.<\/p>\n<h2>Step 1: Creating the WP-Admin Cache Bypass Rule (Priority 1)<\/h2>\n<p>Never cache administrative interfaces or preview links. In Cloudflare dashboard, navigate to <strong>Rules &gt; Page Rules<\/strong> (or <em>Caching &gt; Cache Rules<\/em>) and create your first rule:<\/p>\n<pre style=\"background-color: #1e293b;color: #38bdf8;padding: 14px;border-radius: 6px;font-size: 13px\">URL Pattern: *yourdomain.com\/wp-admin*\nSettings:\n  - Cache Level: Bypass\n  - Security Level: High<\/pre>\n<h2>Step 2: Creating the Preview and Login Bypass Rule (Priority 2)<\/h2>\n<pre style=\"background-color: #1e293b;color: #38bdf8;padding: 14px;border-radius: 6px;font-size: 13px\">URL Pattern: *yourdomain.com\/*preview=true*\nSettings:\n  - Cache Level: Bypass<\/pre>\n<h2>Step 3: Creating the Global Cache Everything Rule (Priority 3)<\/h2>\n<p>Create the primary edge caching rule covering all public content:<\/p>\n<pre style=\"background-color: #1e293b;color: #38bdf8;padding: 14px;border-radius: 6px;font-size: 13px\">URL Pattern: *yourdomain.com\/*\nSettings:\n  - Cache Level: Cache Everything\n  - Edge Cache TTL: 7 days\n  - Browser Cache TTL: 4 hours<\/pre>\n<h2>Bypassing Cache for Logged-In Users via Super Page Cache Plugin<\/h2>\n<p>To ensure logged-in users and WooCommerce shoppers see personalized cart contents without paying for Cloudflare Enterprise, install the free <strong>Super Page Cache for Cloudflare<\/strong> plugin by Optimole. This plugin hooks into WordPress authentication cookies and injects <code>Cache-Control: no-cache<\/code> headers whenever a user logs in or adds an item to cart.<\/p>\n<h2>Advanced Cloudflare Edge Caching: Tuning Cache Keys and Headers<\/h2>\n<p>To maximize your cache hit ratio without serving stale content to active eCommerce shoppers, configure custom <strong>Cache Keys<\/strong> under <em>Caching &gt; Cache Rules<\/em>:<\/p>\n<pre style=\"background-color: #1e293b;color: #38bdf8;padding: 14px;border-radius: 6px;font-size: 13px\">Expression: (http.request.uri.path matches \"^\/shop\/\" or http.request.uri.path matches \"^\/product\/\")\nAction: Cache Everything\nEdge TTL: 1 Month\nRespect Origin Cache-Control Headers: Yes<\/pre>\n<h2>Handling WordPress Nonces and Dynamic AJAX Fragments<\/h2>\n<p>WordPress CSRF security nonces expire every 12 to 24 hours. If full HTML pages are cached at the edge for 7 days, visitors submitting comments or contact forms will receive &#8220;Nonce verification failed&#8221; errors. To solve this, configure contact form plugins (like WPForms or Fluent Forms) to fetch fresh nonces dynamically via asynchronous AJAX requests (<code>\/wp-admin\/admin-ajax.php<\/code>).<\/p>\n<h2>Verifying Edge Cache Hits with CF-Cache-Status Headers<\/h2>\n<p>Inspect incoming HTTP response headers in Chrome DevTools to verify caching behavior:<\/p>\n<ul style=\"padding-left: 20px;line-height: 1.8\">\n<li><code>cf-cache-status: HIT<\/code>: The HTML was served directly from Cloudflare Anycast memory (Sub-30ms response).<\/li>\n<li><code>cf-cache-status: MISS<\/code>: The page was fetched from your origin server and cached for future visitors.<\/li>\n<li><code>cf-cache-status: BYPASS<\/code>: The request matched an admin or checkout bypass rule and was delivered dynamically.<\/li>\n<\/ul>\n<h2>Edge Side Includes (ESI) and Dynamic Micro-Caching on Cloudflare<\/h2>\n<p>For complex WooCommerce stores with active customer accounts, standard page caching can inadvertently cache logged-in customer names or shopping cart totals. Combining Cloudflare Cache Rules with <strong>Edge Side Includes (ESI)<\/strong> allows you to cache 98% of the static HTML markup at the edge while streaming dynamic shopping cart fragments asynchronously via JavaScript Fetch API.<\/p>\n<h2>Benchmarking Edge Cache Everything vs Origin TTFB<\/h2>\n<table style=\"width: 100%;border-collapse: collapse;margin: 20px 0;font-size: 14px\">\n<thead>\n<tr style=\"background-color: #0f172a;color: #ffffff\">\n<th style=\"padding: 10px;border: 1px solid #334155\">Test Location<\/th>\n<th style=\"padding: 10px;border: 1px solid #334155\">Origin Server Direct TTFB<\/th>\n<th style=\"padding: 10px;border: 1px solid #334155\">Cloudflare Cache Everything TTFB<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"background-color: #f8fafc\">\n<td style=\"padding: 10px;border: 1px solid #cbd5e1;font-weight: bold\">London, UK<\/td>\n<td style=\"padding: 10px;border: 1px solid #cbd5e1\">480 ms<\/td>\n<td style=\"padding: 10px;border: 1px solid #cbd5e1;color: #10b981\"><strong>24 ms (20x Faster)<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 10px;border: 1px solid #cbd5e1;font-weight: bold\">Singapore<\/td>\n<td style=\"padding: 10px;border: 1px solid #cbd5e1\">840 ms<\/td>\n<td style=\"padding: 10px;border: 1px solid #cbd5e1;color: #10b981\"><strong>18 ms (46x Faster)<\/strong><\/td>\n<\/tr>\n<tr style=\"background-color: #f8fafc\">\n<td style=\"padding: 10px;border: 1px solid #cbd5e1;font-weight: bold\">San Francisco, USA<\/td>\n<td style=\"padding: 10px;border: 1px solid #cbd5e1\">620 ms<\/td>\n<td style=\"padding: 10px;border: 1px solid #cbd5e1;color: #10b981\"><strong>21 ms (29x Faster)<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div style=\"background-color: #f8fafc;border: 1px solid #e2e8f0;border-left: 4px solid #0ea5e9;padding: 20px;border-radius: 8px;margin: 30px 0\">\n<h3 style=\"margin-top: 0;color: #0f172a;font-size: 18px;display: flex;align-items: center\">\n        <span style=\"margin-right: 8px\">\ud83d\udd17<\/span> Recommended Related Technical Guides:<br \/>\n    <\/h3>\n<ul style=\"margin: 10px 0 0 0;padding-left: 20px;line-height: 1.8\">\n<li><a href=\"https:\/\/cpanelfree.com\/blog\/how-to-setup-free-cloudflare-cdn-dns-hosting\/\" style=\"color: #0284c7;text-decoration: none;font-weight: 600\">How to Set Up Free Cloudflare CDN &amp; DNS on Any Web Hosting<\/a><\/li>\n<li><a href=\"https:\/\/cpanelfree.com\/blog\/dns-a-record-vs-cname-vs-alias-guide\/\" style=\"color: #0284c7;text-decoration: none;font-weight: 600\">DNS A Record vs CNAME vs ALIAS Explained<\/a><\/li>\n<li><a href=\"https:\/\/cpanelfree.com\/blog\/how-to-fix-dns-probe-finished-nxdomain-error\/\" style=\"color: #0284c7;text-decoration: none;font-weight: 600\">How to Fix DNS_PROBE_FINISHED_NXDOMAIN Error<\/a><\/li>\n<li><a href=\"https:\/\/cpanelfree.com\/blog\/best-free-web-hosting-2026\/\" style=\"color: #0284c7;text-decoration: none;font-weight: 600\">Top 10 Best Free Web Hosting Services<\/a><\/li>\n<li><a href=\"https:\/\/cpanelfree.com\/#plans\" style=\"color: #0284c7;text-decoration: none;font-weight: 600\">Explore $0 Free cPanel Web Hosting Plans<\/a><\/li>\n<\/ul>\n<\/div>\n<div style=\"background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);border: 1px solid #334155;border-radius: 12px;padding: 25px;margin: 30px 0;text-align: center\">\n<h3 style=\"color: #38bdf8;margin-top: 0;font-size: 20px\">Edge-Accelerated Free Hosting on CpanelFree<\/h3>\n<p style=\"color: #94a3b8;font-size: 14px;line-height: 1.6;max-width: 600px;margin: 0 auto 15px\">\n        Combine Cloudflare Edge Caching with <strong>CpanelFree<\/strong>&#8216;s high-speed NVMe storage and LiteSpeed acceleration at 100% zero cost.\n    <\/p>\n<p>    <a href=\"https:\/\/cpanelfree.com\/free-wordpress-hosting\" style=\"display: inline-block;background-color: #a855f7;color: #ffffff;padding: 10px 22px;border-radius: 6px;text-decoration: none;font-weight: bold;font-size: 14px\">Deploy Free WordPress Site<\/a>\n<\/div>\n<h2>Frequently Asked Questions<\/h2>\n<div style=\"border-bottom: 1px solid #e2e8f0;padding: 12px 0\">\n<h4 style=\"margin: 0 0 8px 0;color: #1e293b\">Does Cache Everything automatically purge when I edit a post?<\/h4>\n<p style=\"margin: 0;color: #475569;font-size: 14px\">With the Super Page Cache plugin connected via Cloudflare API token, Cloudflare automatically purges the specific post URL and homepage cache instantly whenever you click Update.<\/p>\n<\/div>\n<h2>Automating Cache Purges on Custom Post Types and Taxonomy Archives<\/h2>\n<p>When publishing articles in custom post types or updating product categories, standard caching plugins may only purge the single post URL. In your Cloudflare Cache Rules, configure automated purge tags (Cache-Tag headers) to ensure category archives, author feeds, and pagination pages update simultaneously without manual cache clearing.<\/p>\n<div style=\"border-bottom: 1px solid #e2e8f0;padding: 12px 0\">\n<h4 style=\"margin: 0 0 8px 0;color: #1e293b\">Will Cache Everything conflict with WooCommerce shopping carts?<\/h4>\n<p style=\"margin: 0;color: #475569;font-size: 14px\">Not when using the Super Page Cache plugin, which automatically bypasses edge caching whenever the <code>woocommerce_items_in_cart<\/code> cookie is detected.<\/p>\n<\/div>\n<p>Deploying edge-level Cache Everything rules transforms standard WordPress hosting into an ultra-fast global web application capable of handling viral traffic spikes with sub-30ms response times.<\/p>\n<div style=\"background-color: #f1f5f9;padding: 15px;border-radius: 8px;margin: 20px 0\">\n<h4 style=\"margin-top: 0;color: #1e293b\">Pro Sysadmin Tip: Purging Cloudflare Edge Cache by Tag or Prefix<\/h4>\n<p style=\"margin: 0;color: #475569;font-size: 14px\">Under Caching &gt; Configuration in Cloudflare Dashboard, use Purge by URL or Purge by Prefix to instantly clear updated sections of your site (e.g. \/blog\/* or \/products\/*) without clearing your entire global edge cache.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Quick Answer: By default, Cloudflare only caches static files (images, CSS, JS) and passes all HTML requests to your origin server. Configuring &#8220;Cache Everything&#8221; Page Rules \/ Cache Rules caches the entire generated HTML page across Cloudflare&#8217;s 300+ edge data centers, delivering instant sub-30ms TTFB worldwide while safely bypassing the cache for logged-in administrators and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1488,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[51],"tags":[],"class_list":["post-1489","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials"],"_links":{"self":[{"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/posts\/1489","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/comments?post=1489"}],"version-history":[{"count":6,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/posts\/1489\/revisions"}],"predecessor-version":[{"id":1539,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/posts\/1489\/revisions\/1539"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/media\/1488"}],"wp:attachment":[{"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/media?parent=1489"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/categories?post=1489"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/tags?post=1489"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}