Cloudflare auto purge

Hi everyone, i notice a drop in my website GTmetrix grade after a day and the only way I have been able to resolve this is by manually purging my Cloudflare cache. if I should ask how can I set it to auto-purge after certain hours

You could use a PageRule and set it to match your entire domain and set Edge-Cache TTL to the value you want it to automatically be purged.

Please keep in mind that TTL is the max time cache will exist and is not guaranteed.

Or just run a script with “clear all cache” with a cron as often as you wish.

Thanks Martin,

it was set to a day, but I wonder why it is not working.
however, I have change it to 8 hour because my wp R is set to 20 hours again I hope the URL string is right ?

and is there any rules you think I can add

This rule seems to work:

All headers are set to 86400 (which is exactly 1 day)
Please notice that this time is just ticking/running as soon as it cached on some POPs, so most probably the TTL is different on all POPs

For further investigation please post GTmetrix links where the page is slow and one where the page is fast.
before purging.
after purging

This is 100% not just a “Cloudflare Cache Purge” between these two tests.

Cloudflare does not rename filenames nor does it add or remove some.
But in one test I can see the file “styles.css” and in the other one I can not see it. So I assume that you have also purged WooCommerce/Wordpress cache between these tests?

Also the tests show, that the version before purging is way faster, but yes, performs worse on GPSI and Y-Slow.

No, only cloudflare purge was only done.
wp r just launch a features that remove unused CSS which is why you can not see it in the later GTM analysis.
like i said earlier, the problem has always been the unused css feature, it some how will later reoccur as seen in the earlier GTM analysis. and the only way to revert back is to purge cloudflare manually which is why i ask if it can be done automatically.

again before this time my wp r is set to 20 hours

why cloudflare is set to a day. but I have change it from 1 day to 8 hours

May i ask why WR Rocket is set to 20 hours?
That means: it will work fine 20 hours then WP Rocket cache is cleared. As soon as this happens Cloudflare will cache unoptimized version. Please set it to “0” (unlimited) as cache anyway will be cleared if something changes.


I will observe and revert back. i hope it solves it

Hi Martin,

that seam to solve it with the GTM and pagespeed analysis above. the score are constant without any purge just like the previous days.
however I notice this after a day yesterday which is why i did not reply back yesterday, but once I purge all cache on Cloudflare it will disappear. , i thought is one-off but it occurs again today.

If you purge Cloudflares Cache your site will become slow again for the first call. If this happens please call the page twice or run your Tests twice.

i have but it still persist, but i haven’t purge the cache this moment

this part is affected too.
i have also disable Apo too, any help

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