I am using APO, which works great, except for one thing: I have pages that need to bypass the default APO caching (everything with the url construction /show/*/
). I’m attempting to do this through a combination of setting a cache-header and defining a Cloudflare Page Rule.
Here is a page…
You will see this cache header:
max-age=3600, public
And here is my Page Rule in Cloudflare:
Based upon my understanding, Cloudflare should be purging that page after an hour. I have run several tests, and it’s not purging. I have a Cloudflare Pro account.
Here are the headers coming back in a curl:
content-type: text/html; charset=UTF-8
cf-ray: 85877c033f937cff-EWR
cf-cache-status: HIT
age: 43972
cache-control: public, max-age=3600
last-modified: Tue, 20 Feb 2024 02:23:55 GMT
link: <https://www.tvinsider.com/wp-json/>; rel="https://api.w.org/"
vary: Accept-Encoding, Accept-Encoding,Cookie
cf-apo-via: tcache
cf-edge-cache: cache,platform=wordpress
x-cache: HIT: 2
x-cache-group: normal
x-cacheable: SHORT
x-powered-by: WP Engine
report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=sa%2B5hQrkiRjXXuXHq3l%2B0HXhkuOgoK%2FLq3GHAmGcOQMQTG%2FpqUzOoPQYMQaZTdspAsElJQiDzMHqQqjEPafnWrUE6KfSbtjEqA0SMa9VMeae9jVLB3TcIH%2F4XnGaZ%2Ft%2BfriQ"}],"group":"cf-nel","max_age":604800}
nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
server: cloudflare
alt-svc: h3=":443"; ma=86400
Some things I notice in those headers:
-
cf-cache-status: HIT
. It’s hitting Cloudflare. -
cf-apo-via: tcache
. It’s running through APO. -
cache-control: public, max-age=3600
. Cache is being set to 1 hour. -
age: 43972
. Cache is wildly surpassing the 1-hour limit. (You’ll see a higher number.)
I’m stymied. Cache will stay there for days unless I resort to the nuclear option — the “Purge Everything” button.
What am I doing wrong? Help is greatly appreciated. Thanks!