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.
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.
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.
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”
Then
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.
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
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
setting it to Override Origin, then specifying the time in seconds, or
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.