Skip to main content

APO Configuration

Cloudflare APO (Automatic Platform Optimization) caches WordPress HTML at the edge so visitors around the world see low-latency TTFB. The key is to cache public pages aggressively and bypass anything that is personalized (logged-in users, cart/checkout, account).

What APO Changes

  • HTML can be served from the edge (not just static assets).
  • Purge behavior is tied to WordPress updates when the Cloudflare WP plugin is connected.

Static vs Dynamic

  • APO ON
  • Long TTL (purge on updates)
  • Minimal bypass rules

Setup Checklist

  1. Enable APO in the Cloudflare dashboard.
  2. Install and connect the Cloudflare WordPress plugin.
  3. Confirm APO is enabled in the plugin.
  4. Add bypass rules for dynamic routes and auth cookies.
  5. Verify with headers.

Bypass Rules (Typical)

Bypass caching for:

  • /wp-admin*
  • /wp-login.php*
  • /cart*, /checkout*, /my-account*
  • Requests with auth/session cookies (example: wordpress_logged_in_)

Verification

Public page (should be HIT after warm):

curl-apo-hit.sh
curl -I https://example.com/

Example signals:

apo-hit-example.txt
cf-cache-status: HIT
cf-apo-via: cache

Checkout (should bypass):

curl-checkout-bypass.sh
curl -I https://example.com/checkout/
apo-bypass-example.txt
cf-cache-status: BYPASS

Common Mistakes

MistakeWhat HappensFix
No bypass rules for Woo routesBroken carts/checkoutAdd path bypass for cart/checkout/account
No cookie bypass for logged-in sessionsCached HTML served to authenticated usersBypass when auth cookies are present
Very short TTLLow hit rateUse longer TTL + purge on updates

What's Next