Apo not working?


we had to set up the CDN again after problems with the SSL Certificates of our provider.

Before we booked APO, our website had a server time (measured in Matomo) of around 2,3 seconds. With APO of around 0,3 seconds.

After reinstalling the CDN at our provider, it went back to 2,3 seconds. The test as described in the tutorial looks ok.

But it looks like that the HTML is loading from our server, dynamically generated in Wordpress. And this takes 2 seconds longer, then getting the HTML directly from the CDN. So I assume that APO is somehow not configured correctly.

Any ideas how to fix that?

Thanks and have an awesome week!

What’s your domain? Please provide your domain as example[.]com or marked as code </>.

Thank you.
message(minus)for(minus)you(dot) net

No, it is not loading from your server. APO is working as expected and HTML is loading from cache as indicated by the headers cf-apo-via: tcache. and cf-cache-status: HIT

Now your installation has many dynamic elements which are not cacheable. For instance, requests to the Google Translator app, which is not part of your domain, and therefore is not proxied by Cloudflare, as well as requests to your domain with query strings, such as requests to the plugin Matomo.

Cloudflare APO only caches files in your domain, and when they do not have a query string or a cookie indicating the content is dynamic. If these requests were cached, your site would stop working as expected.

1 Like

thank you very much for your help!

the dynamic elements had not been a problem before the reinstall. I think, Rocketloader should have deferred them to not cause this problem.

But I checked a few minutes ago and Rocketloader was not active in Cloudflare Dashboard after the reinstall. But it was loaded by the website.
I activated it and will see, if that will solve the problem.

1 Like

could it be that the string /?gad=1 will bypass the cache?

From our notes, we ve discovered that the string appeared shortly after the date of the re install (within a few days).

The exceptions to this rule are listed here:

1 Like

ok and thank you.

Is there any way around this?
I ve made a post so that they can add the string onto that list

Assuming the URL with this query string parameter is based on your proxied domain, you can create a Cache Rule for

When incoming requests match…
URI Query contains “gad=1”
Eligible for cache

This will make any such URLs to be cached by standard Cloudflare cache. While not as efficient as APO cache, it’s better than having requests lending at your origin every time.

1 Like

thank you, it seems to work.

I ve set up the rule.

The HTML cache has to be pre generated by WordPress. We re using the WP-Optimize Plugin for that. With a setting to refresh the cache every three hours.
This is not optimal, but should work

thank you a lot

1 Like

the cached files are expiring very quickly.
i ve tried to set all values in the cache rule to 3 days and purging + preloading the files in WP optimize every 3 hours

You can set the Edge Cache TTL right on the same Cache Rule that you created for these pages, either by

  1. setting it to Override Origin, then specifying the time in seconds, or
  2. setting it to Respect Origin and config your origin to set the header Cloudflare-CDN-Cache-Control.

Whatever you do, keep in mind that the APO invalidation logic will not apply here, and so you need to have your own mechanism to purge the Cloudflare cache for those URLs.

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