Just out of curiosity, what would a Custom Purge mechanism do for you? It is already doing automatic selective purging of just affected pages when you do things like add/edit posts.
I tend to forget that edits clear the page at hand and in the moment I unnecessarily purge the whole enchilada, so most of the pages don’t get reloaded unless I run a site audit. What a waste, but not a big deal for a microsite like mine. And I think I’ve only ever used Custom Purge a couple times. The feature wouldn’t be so much for a low traffic site like mine, I guess. I thought it might be useful for a site with higher traffic, just throwing it out there as a possible feature, as CF offers it, but I see your point.
-
This reply was modified 1 year, 1 month ago by
justdontknow.
If you are referring to Cloudflare’s ability to purge based on hostname, tag or URL prefix, those abilities only apply to Cloudflare Enterprise plans, so it wouldn’t even be possible with 99.99% of sites using Cloudflare.
That being said, those functions are honestly more of a lazy way to do things when your backend doesn’t support more granular purging (for example maybe your blog is on a certain hostname separate from the main site and you don’t want to purge the entire zone). But… this plugin is already doing the granular purging (purging only what’s needed). Which is going to be better than any of the “special” Enterprise-tier purging options anyway.
Again, those are really only useful if you don’t want to be bothered with trying to figure out which exact URLs need to be purged… so even if the “special” purge options were available for all tiers, the way we are doing it is better (but more backend code) because we are purging ONLY what’s needed rather than a larger subset of the zone.
If you are really bored (hah), you can see the purgeCacheByPostId function and how it’s figuring out the exact URLs to purge when a post or created/edited/deleted. As a bonus, that purge mechanism is also decoupled from the UI… the URLs to purge are sent to WordPress’ cron system so they are immediately purged, but the underlying API calls aren’t slowing the user down (even if it would only be for a fraction of a second).
TL;DR: the plugin is already doing it in a way that’s better than Cloudflare’s purge options for it’s enterprise tier. 🙂
-
This reply was modified 1 year, 1 month ago by
digitalpoint.
Well, I am lazy, so… 😂
The code is way over my head. Cutting and pasting php snippets is about all I can handle…I didn’t realize how much of the work is being done in the backend before it gets to CF. I appreciate the added functionality, as I don’t expect to be on Enterprise anytime soon (ever). Biggest concern now is you don’t get headhunted by CF… 😉
Hah… well then just trust that it’s already purging cache in a very efficient way (no need to buy the premium version). You never need to touch the Purge Cache function unless you are doing development stuff on your own or doing things like changing themes. 🙂
No development here. I’m using a 2024 child theme, trying to keep everything as minimal as possible. But as the child is 99.99% visual block editor on the fly, my hack assembly is a bit of a CSS and JS snafu. I probably should address the CSS first, but instead of tackling that on the pages in question (er, all of them…), I’m starting to experiment with minification, deferring, and async to resolve loading issues as a whole. I’m starting with basically zero knowledge. So, my last (hopefully..) question is, when I’m trying different options wrt minification, deferring, and asyncing, should I purge CF cache and/or purge minification when offered by the plugin at hand (eg, WPO, which I’m currently using) after each operation, or is that something AFC does by default, so I can leave it alone?
Ya… if your site isn’t getting a tremendous amount of traffic (like you need to be extra wary like only purging cache at certain times of day so the traffic doesn’t wreck your site), the easy thing to do is just purge the whole cache when you are making changes like that. If you want to be a little more granular, you can add a Page Cache rule in Cloudflare dashboard to tell it to never cache certain URL(s). I sometimes do that when I’m doing JS or CSS stuff so I don’t need to bother purging the cache with every change.
And then you just delete/disable the rule when you are done mucking around.
Great, thank you for the tips.