Skip to content

About

Last updated View as MarkdownAgent setup

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. This process removes round trips from the origin to drastically improve time to first byte (TTFB) along with other site performance metrics. In addition to caching dynamic content, APO caches third-party scripts to further reduce the number of requests that leave Cloudflare's edge network.

With APO, you can manage your WordPress site as normal. Whenever you update content in WordPress, Cloudflare updates content on our edge to prevent serving stale content when you use Cloudflare's WordPress plugin. Additionally, for logged-in or administrator users, we bypass the cache to ensure that private content is not cached and served to other visitors. Find more about what APO can do for you. ↗︎

How APO decides what to cache

APO only caches a response as HTML when the request and the origin response meet all of the following criteria. When any criterion is not met, the request bypasses the cache and is served from the origin (cf-cache-status: DYNAMIC), and the cf-apo-via response header indicates the reason.

  • Request method is GET or HEAD.
  • HTML eligibility is met, based on the request's Accept header and URL path:
    • Accept: text/html (with a quality value greater than zero) is treated as an HTML request.
    • Accept: text/html; q=0 explicitly refuses HTML and is not cached as HTML.
    • When the Accept header does not mention text/html — including Accept: */* or a missing Accept header — the URL path is used instead: non-static paths (such as a page or post) remain eligible, while static file extensions do not.
  • Origin response returns HTTP 200 with a Content-Type of text/html.
  • The cf-edge-cache response header from the WordPress plugin permits caching (for example, cache,platform=wordpress, and not no-cache).
  • No bypass cookies are present (for example, logged-in, session, or WooCommerce cookies).
  • No cache-bypassing request headers (such as Cache-Control: no-cache) or risky headers (x-host, x-forwarded-host, x-original-url, x-rewrite-url) are present.
  • The URL path is not an excluded path (such as checkout, wp-cron.php, or feeds).
  • Query strings are either absent or limited to the supported marketing parameters. For more information, refer to Query parameters and cached responses.
  • No Page Rule with Cache Level: Bypass matches the request. For more information, refer to Page Rule integration with APO.

Limitations

Automatic Platform Optimization is not compatible with Enterprise subdomain setup when a subdomain, for example, www is in a different zone to the apex domain.

Was this helpful?