I have a wordpress site with WP rocket for speed optimisation.
When I enable the proxy on Cloudflare, the performance becomes cyclical. Every two hours it takes 7-8 seconds to load, and the other hours it takes 2 seconds.
When I disable the proxy on Cloudflare I get 4-5 seconds consistently. Any ideas what’s causing this?
Ahh, nevermind I found a link to the latest report
It seems the slowdown is caused by cache expiration (check the CF-Cache-Status header in the waterfall). When the cached resource expires, Cloudflare needs to revalidate it, which requires a request to the origin. If the cache TTL is set to 2 hours, that would explain why every other measurement is slow.
Although this assumes GMetrix is the only visitor to the site going through the SEA colo - or at least the first visitor after the cache expires.
Assuming my theory is correct, the GMetrix measurements are probably not representative of real world performance. If you did a measurement ever minute, you would still only see a spike every 2 hours.
In this case, you might benefit from enabling Tiered Caching in the dashboard.
I would recommend against setting browser caching to a year unless you are absolutely sure content will not change. It will just cause problems when your content updates.
The first visitor connecting through a colo after the cache expires will always have a slower experience than subsequent visitors. This is because each colo has its own cache. However, I believe the delay could be significantly reduced by turning on Tiered Caching in Caching → Tiered Cache.