Hey guys
New to Cloudflare. Just some quick info- I am hosted on Kinsta. Please also note I am not that technical
So after reading a host of articles, I’ve started playing around with the Page Rules within CloudFlare, and also have the Wordpress Plugin to enabled automatic cache management.
1 website URL/preview=
Cache Level: Bypass On2 website URL/?s=*.
Cache Level: Bypass On3 website URL/wp-admin*
Browser Integrity Check: On, Security Level: High, Cache Level: Bypass, Disable Apps, Disable > Performance On4 website URL/
Cache Level: Cache Everything
So I have the above rules enabled right now, and all seems fine (unless someone tells me otherwise) apart from… the Full Page Cache rule!
The vast majority of the site is static, however there are a few areas which I guess can be classed as ‘dynamic’ and I can’t work out why I am not being served the latest versions of some things. Let me bring it to life
If I take my posts (single posts) for example, there are calls to various PHP files which will load content. One such example is within here: https://wrestling-edge.com/rey-mysterio-will-be-announcing-retirement-on-next-weeks-raw/
Below the tags there is some Google Matched Content. This code is generated from: https://wrestling-edge.com/wp-content/themes/wrestlingedge/page-templates/partials/outbrain.php (Will refer to as Outbrain.php from now on due to link restriction limit)
Now that file will maybe be updated once or twice a year. I’ll maybe change Google Matched Ads to Taboola code or something for example.
Here are the steps I undertook to test this:
-
Add a rule to ‘bypass cache’ for outbrain.php and put at Number 1 in the list.
-
Updated said file with some generic text.
-
Customed purged URL: outbrain.php
Following this, I tested some single post links and they were still showing the old version!
The only way to resolve this for me was to turn off the Cache Everything site-wide rule, purge specific post URLs or purge everything.
I think I am probably getting confused with best practice steps I need to take for scenarios like this so would appreciate some guidance for this specific scenario on what would be right steps/changes to make in future. There are other scenarios I have like this on the site with items in the sidebar for example too which reference specific PHP files.
Thank you so much