Skip to content
AnswerWell geo Documentation

Research · 8 min read · Answerwell

WordPress Edge HTML Cache: Automatic Platform Optimization Eligibility, Setup and Status Headers

How Cloudflare APO caches WordPress HTML at the edge, when requests bypass cache, and how to activate the plugin and verify HIT responses.

This page summarises Cloudflare’s documentation on Automatic Platform Optimization (APO) for WordPress: serving much of the site—including dynamic HTML—from the edge, keeping content fresh when you publish, and reading CF-Cache-Status, cf-apo-via, and cf-edge-cache when something looks uncached.

What Automatic Platform Optimization does for WordPress

Section titled “What Automatic Platform Optimization does for WordPress”

APO is Cloudflare’s paid add-on (included on Pro and higher; Free plan users purchase it separately) that goes beyond caching static files. It uses Workers to cache dynamic HTML and third-party scripts so visitors often get full pages from the edge, which cuts origin round trips and improves time to first byte (TTFB).

With Automatic Platform Optimization (APO), Cloudflare serves your entire site from our edge network, ensuring customers see improved performance when visiting your site. Cloudflare typically only caches static content, but with APO, we can also cache dynamic content — like HTML — to serve the entire site from the cache.

— Cloudflare, About

You manage WordPress as usual; the Cloudflare WordPress plugin purges edge cache when content changes. Logged-in and administrator sessions bypass cache so private content is not shared. You must use the Cloudflare for WordPress plugin to enable APO (overview).

APO caches a response as HTML only when every criterion below is met. If any fail, the response is served from the origin with cf-cache-status: DYNAMIC, and cf-apo-via explains why (About).

Area Requirement
Request GET or HEAD only
HTML eligibility See Accept header and URL path
Origin response HTTP 200, Content-Type: text/html
WordPress plugin cf-edge-cache allows caching (for example cache,platform=wordpress, not no-cache)
Cookies No bypass cookies (logged-in, session, WooCommerce, etc.)
Request headers No Cache-Control: no-cache or risky headers (x-host, x-forwarded-host, x-original-url, x-rewrite-url)
Path Not excluded (checkout, wp-cron.php, feeds, etc.)
Query string Absent or only supported marketing parameters
Page Rules No matching Cache Level: Bypass (Page Rule integration)

By default, URLs with unsupported query parameters bypass cache and fetch fresh HTML from the origin—except for the allowlisted UTM and attribution parameters listed in Query parameters and cached responses.

Accept header and URL path: APO HTML eligibility

Section titled “Accept header and URL path: APO HTML eligibility”

APO treats a request as HTML caching eligible based on Accept and the URL path:

  • Accept: text/html with quality greater than zero → HTML request.
  • Accept: text/html; q=0 → explicitly not cached as HTML.
  • If Accept omits text/html (including Accept: */* or a missing header), APO uses the path: non-static paths (pages, posts) stay eligible; static file extensions do not.

Cloudflare fixed a regression where crawlers, bots, and uptime monitors without Accept: text/html stopped being cached; those requests are cached again with no action required. If you added a Transform Rule to force Accept: text/html, you can remove it (changelog).

For deterministic tests, send a browser-like header (Verify APO works):

curl -svo /dev/null -A "CF" 'https://example.com/' -H 'accept: text/html' 2>&1 | grep 'cf-cache-status\|cf-edge\|cf-apo-via'

Activate APO: purchase, plugin, and API token

Section titled “Activate APO: purchase, plugin, and API token”
  1. On Free plans, purchase APO under Speed → Settings → Content Optimization before installing the plugin. Pro and higher can skip purchase (Activate the Cloudflare WordPress plugin).
  2. Install and activate the Cloudflare plugin from Plugins → Add new in WordPress.
  3. In the plugin Settings, sign in with an API token from the Cloudflare dashboard, Save API Credentials, click Apply for recommended WordPress settings, and turn Automatic Platform Optimization On.
  4. Complete DNS and nameserver steps from Get started if you have not already.

Cloudflare recommends turning off overlapping cache plugins (WP Rocket, W3 Total Cache, and similar) during initial setup, clearing their server cache after APO activation, then testing whether re-enabling them helps or conflicts (Activate the Cloudflare WordPress plugin). Many plugins are listed as compatible in Plugin compatibility (for example WP Rocket 3.8.6+); multisite remains unsupported.

Automatic Cache Management in the plugin purges Cloudflare cache when posts, pages, attachments, comments, themes, or customizer settings change (Automatic Cache Management).

Subdomains and subdirectory-only WordPress installs need plugin 4.4.0+ and correct hostname selection; non-WordPress paths can opt out with cf-edge-cache: no-cache (Subdomains and subdirectories).

CF-Cache-Status: HIT, DYNAMIC, BYPASS, and MISS with APO

Section titled “CF-Cache-Status: HIT, DYNAMIC, BYPASS, and MISS with APO”

The CF-Cache-Status response header shows whether Cloudflare served from cache (Cloudflare cache responses). For APO troubleshooting, three values matter most:

Status Meaning for debugging
HIT Served from Cloudflare cache (goal for anonymous HTML).
DYNAMIC Request was not eligible for cache at request time (APO criteria or no rule to cache HTML).
BYPASS Request was eligible, but the origin response or headers prevented storing (for example Set-Cookie, no-store, size limit).
MISS Cacheable, but not in cache yet; repeat requests should often become HIT. Uncacheable responses now return BYPASS, not repeated MISS (BYPASS status changelog).

Cloudflare returns BYPASS — not MISS — for responses it chooses not to cache. MISS is reserved for cacheable responses that were not in cache at request time.

— Cloudflare, Investigate uncached responses

DYNAMIC with APO often means an eligibility rule failed (method, cookies, query string, Page Rule bypass, or HTML not recognised). BYPASS on a homepage can be misleading if Chrome DevTools is open—it sends Cache-Control: no-cache by default; disable “Disable cache (while DevTools is open)” to see HIT and APO headers (FAQs).

If curl shows MISS or DYNAMIC while a browser shows HIT, compare Accept headers and path rules above (FAQs).

For general CDN assets (not only APO), DYNAMIC also appears when no Cache Rule caches that extension, a Bypass cache rule matches, or Development Mode is on for three hours (DYNAMIC, Development Mode).

APO headers: verify the WordPress integration

Section titled “APO headers: verify the WordPress integration”

When APO works, responses should expose cache and plugin signals (Verify APO works):

Header Working example Role
CF-Cache-Status HIT Cache hit vs dynamic origin fetch
cf-apo-via tcache or cache (per verification tool output) APO routing for the request
cf-edge-cache cache,platform=wordpress WordPress plugin permits edge caching

After publishing a change, a refresh should eventually show cached HTML with CF-Cache-Status: HIT when integration and purge hooks work (Verify APO works).

Worker subrequests in zone logs are expected—APO uses Workers internally (FAQs).

Page Rules, device type, and cache rules that affect APO

Section titled “Page Rules, device type, and cache rules that affect APO”

Page Rule integration with APO lists rules that change APO behaviour (purge cache after changes):

  • Cache Level: Bypass → cf-apo-via: origin,page-rules
  • Cache Level: Ignore Query String / Cache Everything → query-string handling
  • Edge Cache TTL / Browser Cache TTL → overrides default 30-day edge behaviour
  • Bypass Cache on Cookie (Business and Enterprise) → extra cookie bypass patterns

Cloudflare recommends Cache Rules for new configuration instead of Page Rules where possible.

Cache by device type splits cache entries by mobile, tablet, or desktop from User-Agent, sends CF-Device-Type to the origin, and invalidates cache when toggled (Cache by device type). The WordPress plugin purges variations on update; test mobile-specific plugins carefully.

A Cache Rule set to Bypass cache may still show DYNAMIC rather than a explicit bypass label when the asset was never eligible (Available settings).

  • Stale front page after edits — Purge cache with APO enabled (Troubleshooting).
  • Dashboard does not detect the plugin — Use plugin 4.4.0+, enable APO from WordPress, purge legacy cache plugins (Troubleshooting).
  • Marketing URLs always hit origin — Only allowlisted query keys are cached; others need design changes or community allowlist requests (Query parameters).
  • Conflicting page rules — “Cache Everything” is redundant with the plugin; rules that bypass cache can break APO (FAQs, Page Rule integration).
  • Misreading analytics after BYPASS labelling — Miss rate may drop and bypass rate rise for never-cacheable responses; origin traffic is unchanged (changelog analytics).
  • Caching user-specific HTML — Do not cache responses that depend on per-user input without understanding poisoned-cache risk; static assets are the usual cache targets (Avoid web cache poisoning).
  1. Request your homepage twice with accept: text/html and confirm CF-Cache-Status: HIT, plus cf-edge-cache: cache,platform=wordpress (Verify APO works).
  2. Publish a small WordPress change, wait for automatic purge, and confirm the updated content appears while cache headers still show a hit for anonymous visitors (Verify APO works).
  3. In the Cloudflare dashboard Overview, review Cache Performance and filter statuses such as MISS or DYNAMIC for URLs that should be edge-cached (Troubleshooting a slow website).
  4. If status stays DYNAMIC or BYPASS, map the value to Investigate uncached responses and recheck APO eligibility (cookies, query strings, Page Rules).
  5. You can check automatically in Answerwell (our tool): https://answerwell.org/workspace

If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact statement you are asking about, and we will correct or clarify it.