What is still being cached when using APO and Bypass the whole site?

I have a WordPress website using APO and set a Page Rule to Bypass the whole website (www.example.com/*). Does APO still caching core files or what exactly is still being cached even when entire website is bypassed? Any insight would be greatly appreciated!

If that Page Rule is a Match, it should override any caching.

Is something not working?

1 Like

With APO and Bypassing the whole website with this Page Rule. I’ve noticed that some files still get caches and in the HTTP response header it has “cf-edge-cache: cache,platform=wordpress”. Does this mean APO still caches Wordpress core files and if so which ones exactly? That is the question…

Can anyone share some insight into this? Thanks!

My first question would be:
Why would you ever do this?
It’s like buying a service to not use it. You can do this, but I don’t see any reason to do so. Just disable APO for this domain/subdomain and the problem should be solved.

Yes, the docs can: https://developers.cloudflare.com/automatic-platform-optimization/reference/page-rule-integration

It clearly states, that with a matching PageRule and “Cache: Bypass” you can bypass APO cache.

The following Page rules can control APO. Any changes to Caching page rules require purging the cache for the changes to take effect.

(please notice the marked sentence: you need to purge the cache after setting the PageRule up, to make it take effect.)

2 Likes

Yes, APO caches the whole page of my Wordpress website. I can create a Page Rule to Bypass any webpage and that page will not be cached. I can check the Response Header and the page is being Bypass for sure… but I cannot check to see which Wordpress core files are being cached and which are not… Because it says “cf-edge-cache: cache,platform=wordpress” does this mean APO know which WP core files to cache and which not too? Or, does APO just cache everything in the directory?
I am thinking APO caches everything in the directory, WP core files/folder and all… Since there is no documentation on which WP core files it does not cache using APO.

This header only means the Cloudflare plugin is installed. It shows in installations with the Cloudflare plugin, even without APO enabled.

You’d need to see two other headers that confirm (1) page is cached, (2) by APO

https://developers.cloudflare.com/automatic-platform-optimization/get-started/verify-apo-works

In WordPress parlance, “core files” are the PHP files that make WP work. Is that what you mean? Cloudflare should not cache them. Very few of them (like /wp-login.php) should be available to website visitors; the vast majority are only needed internally for WP itself, the theme and plugins.

3 Likes

I think I get it now… APO uses the Default Cache Behavior ( https://developers.cloudflare.com/cache/about/default-cache-behavior ) by caching all CSS, JS, JPG, PNG, etc… of the WP core files… It does not cache the main PHP core files in your WP install… But it will cache other PHP files in that directory, outside of wp-admin, wp-content, wp-includes…

It will never cache any PHP file, what is may caches is the output of a PHP file, but a PHP file itself is dynamically and can not be cached (properly) by a static cache.

4 Likes

Create a new-folder in your root directory along with the wp-admin, wp-content, and wp-includes folders. Then, in that new folder place a simple PHP file. Go to the your website and type in the URL of where that PHP file is (i.e., www.example.com/new-folder/simple.php) to see if it displays. Then go to HTTP response header check | Uptrends and paste the same URL (i.e., www.example.com/new-folder/simple.php) in where it says: I want to test… Look at the “CF-Cache-Status:”

Like I said, it does not cache a PHP file. You will not find any PHP tag in the cched response. What it does is: it caches the HTML (which is generated with PHP) under a link that does end with “.php” but the real PHP file is not gettig cached, just its output.

3 Likes

Great! This is what I thought was happening. Thanks for all the insight!

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