Features Pricing Reviews FAQ
Get Plugin

Cloudflare APO (Automatic Platform Optimization)

4 min read

Cloudflare APO lets Cloudflare cache your full HTML pages at its edge, not just images and other static files. This Pro module turns APO on or off for your connected Cloudflare zone and sets the edge cache level and browser cache time.

What this does

Normally Cloudflare only caches static assets like images, CSS, and JavaScript. Your HTML pages still come from your own server. Automatic Platform Optimization (APO) changes that by letting Cloudflare serve cached HTML from its edge network too, while still respecting logged-in cookies so signed-in users get fresh pages.

The Cloudflare APO module gives you three actions from inside xSpeed Cache:

  • Turn APO on or off for your zone.
  • Set the zone-level Cache level.
  • Set the Browser cache TTL (how long browsers may keep files).

It uses the same Cloudflare zone and credentials you already set up in the free Cloudflare module, so you do not enter your zone ID or API token a second time.

Why use it

If Cloudflare sits in front of your site, caching HTML at the edge means many visitors get a page straight from Cloudflare, close to them, without a round trip to your server. That can lower your server load and speed up page loads for repeat and worldwide visitors.

Requirements

  • xSpeed Cache Pro must be active.
  • Cloudflare must be connected in the free Cloudflare module, with a valid Zone ID and API credentials. The APO module reads that same connection.
  • Your Cloudflare plan must support APO. Cloudflare offers APO on its paid plans, or as a paid add-on on the free plan.

Note: If Cloudflare is not connected yet, the module returns a clear message asking you to add your zone ID and API token in the Cloudflare module first. Set up Cloudflare there before using APO.

How to set it up

  1. First connect Cloudflare in the free Cloudflare module (Zone ID plus an API Token or Global API Key). See Cloudflare Integration.
  2. In the xSpeed Cache settings, open the Cloudflare APO module.
  3. Choose your Cache level and Browser cache TTL (seconds).
  4. Save your settings, then use the module’s controls to sync those values to Cloudflare and to toggle APO on.

Settings explained

SettingWhat it doesDefault
Cache levelCloudflare’s zone-level cache levelAggressive
Browser cache TTL (seconds)How long browsers may keep cached files14400

Cache level. Sets Cloudflare’s cache level for the whole zone. The options are:

  • Basic — the most limited caching.
  • Simplified — ignores query strings when caching.
  • Aggressive — caches every static asset, including query-string variants. This is usually what you want.

Default: Aggressive.

Browser cache TTL (seconds). Tells Cloudflare how long a visitor’s browser may keep cached files before checking again. The default is 14400 seconds (4 hours). Cloudflare only accepts a fixed set of values, so xSpeed Cache snaps your number to the nearest legal one (for example 0, 30, 60, 300, 1800, 3600, 7200, 14400, and higher). Default: 14400.

Note: Setting the cache level does not by itself turn APO on. The cache level and browser TTL are separate zone settings. Use the module’s toggle to enable APO.

Best practices

  • Leave Cache level on Aggressive unless you have a specific reason to change it.
  • Connect and verify Cloudflare in the free module first, so the APO module has a working zone to talk to.
  • Confirm your Cloudflare plan includes APO before turning it on.

Troubleshooting

I get a message that Cloudflare is not configured. Open the free Cloudflare module and add a valid Zone ID and API credentials. The APO module reads that same connection.

The message says my Zone ID looks invalid. A Cloudflare Zone ID is a 32-character string of lowercase letters and numbers. Find it on your domain’s overview page in Cloudflare, under API → Zone ID, and update it in the Cloudflare module.

The message says authentication is missing. Add your API Token, or your Global API Key together with your account email, in the Cloudflare module.

FAQ

Do I need to enter my zone ID again for APO? No. The APO module reuses the zone and credentials from the free Cloudflare module.

Does APO cache pages for logged-in users? APO on Cloudflare’s side respects WordPress logged-in cookies, so signed-in users are not served a shared cached page.

Why did my browser TTL change to a different number than I typed? Cloudflare only accepts certain values. xSpeed Cache snaps your entry to the nearest allowed value.

  • Cloudflare Integration
  • Setting Up a CDN
  • Configure Browser Cache