APO: tiered caching testing

APO uses two-layer caching: regular Cache and KV. We get the best of two worlds:

  • faster responses when local Cache has content.
  • serving content from KV instead of going to the origin on Cache miss.

In a nutshell, it is a DIY version of Cloudflare Tiered Caching with Generic Topology. Internally we discussed if APO should utilize Tiered Caching technology instead of Local Cache + KV. With the growing usage metrics, it becomes clear the question is not if but when.

I’m excited to say we are starting to test APO tiered caching (HTML only) in a limited capacity in some colos around the world.

We expect no visible changes to APO customers, though some side effects could happen.
Expected effects of Tiered Caching:

  • slight changes in Cache hit ratio
  • decrease the load on origin servers
  • faster p95 response times for APO sites.
5 Likes

Is it already rolling out? I see some users asking something about “tcache” header. Is this related to Tiered Caching?

We rolled out yesterday to the majority of customers who have APO subscription on Free and Pro plans. tcache is the indication we served content with tiered cache technology.

4 Likes

I received an email ~7 hours ago saying that I need to activate the Cloudflare plugin to take full advantage of APO and the new tiered caching. I have it activated already, and I haven’t been messing around with the settings recently. The “Speed” tab in my Cloudflare dashboard shows a button to enable APO, but that’s already enabled too. (I see APO response headers and I get billed for it each month, so I’m fairly sure it’s turned on.)

Edit: The “/speed/optimization” tab does show that APO is enabled, and running another check still doesn’t recognize the plugin as active.

Could this be an issue with WP Rocket compatibility? I don’t use the Cloudflare addon in WP Rocket because of issues between the two when APO launched.

Please try the following steps to fix compatibility:

  • go to Cloudflare WordPress plugin
  • disable APO in the card
  • enable APO in the card (will set proper settings for APO feature)
  • clear WP Rocket server cache (or/and any other server cache)
  • verify that your origin starts serving response header “cf-edge-cache: cache,platform=wordpress”

Optional step: once the origin starts serving the response header WP plugin check will pass in the dashboard.

This is the most common issue with APO compatibility: once APO is enabled all server caches requires purge & restart.

2 Likes

I do have this, but I also see

cache-control: no-store, no-cache, must-revalidate

Seems conflicting, is this normal?

$ [-] curl -I https://cxl.com
HTTP/2 200 
date: Tue, 09 Mar 2021 11:07:03 GMT
content-type: text/html; charset=UTF-8
set-cookie: __cfduid=d8362afe81500f540460a38db9667ae9d1615288023; expires=Thu, 08-Apr-21 11:07:03 GMT; path=/; domain=.cxl.com; HttpOnly; SameSite=Lax
cf-edge-cache: cache,platform=wordpress
expires: Thu, 19 Nov 1981 08:52:00 GMT
cache-control: no-store, no-cache, must-revalidate
pragma: no-cache
link: <https://cxl.com/wp-json/>; rel="https://api.w.org/", <https://cxl.com/wp-json/wp/v2/pages/57454>; rel="alternate"; type="application/json", <https://cxl.com/>; rel=shortlink
set-cookie: PHPSESSID=bceec567ef28ea9b13985d2f3a9a8e09; path=/; secure
cf-cache-status: DYNAMIC
cf-request-id: 08b8444fe500003769448bf000000001
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
server: cloudflare
cf-ray: 62d3d65fcb353769-HEL
alt-svc: h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400

This is quite common, we will ignore cache-control for edge caching, it will only be used on the client.

1 Like

This seems to have done the job so far. WordPress plugin successfully detected on the hostname (from plugin check on CF dashboard). And I’m seeing all of the header response you mentioned. Thanks. I’ll see how it goes.

2 Likes

Hi,
Are all issues with APO solved now? I saw some users reporting cache not being cleared. Is it solved now? So I can enable APO and test it.

yes, it should be stable, please give it a try.

1 Like

This is amazing, tiered cache can be a noticeable performance boost in some scenarios.

Our internal measurements demonstrated 30% improvement in p90, and 60% in p99, so this is true.

2 Likes

That’s great, we were considering using wordpress in our new website purely because of APO and the speed that we could reach, however, we found that the dependencies that some wordpress plugins import are ridiculously big and the optimizations performed by APO were not enough to justify the page size that the WP page had (just to clarify, this does not have to do anything to do with Cloudflare but Wordpress), we ended up building our site using react.
I believe that enterprise customers have access to tiered caching independently from APO, do you know if business customers will be eligible for that in the near future? Because that would be amazing.

I don’t think Tiered caching will be included into tier plan any time soon. The reason for this is Tiered caching is a part of Argo offering. Argo is per-usage billed product. It’s hard to make per-usage product commercially viable in the general use case. I can be wrong :slight_smile:

1 Like

What I can tell you that Cloudflare Pages sooner or later will have some kind of Tiered caching support. You can check it out: https://developers.cloudflare.com/pages/

1 Like

Oh, we already use argo, I thought it was limited to improve speed by finding the best route to our backend, I had no clue that tiered caching was part of Argo service.

That’s great, I will check it out!

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.