Issue with Excluding from Cache: Dynamic Content on Woocommerce Product Page

I have a plugin that inserts an estimated delivery date in Woocommerce product pages right above the add to cart button. I cannot figure out how to exclude this part of the page from caching. Basically the delivery date often will show a date in the past until I clear the cloudflare cache. I’ve already created page rules in cloudflare to exclude the entire plugin folder directory, but that has not helped. I’m guessing this because it inserts the estimated delivery date through html. How can I go about excluding this? I tried lowering the “Browser Cache TTL” to 1 hour, but the problem still occurs. The only thing that fixes the issue is if I manually go in every day and clear the cloudflare cache so that the estimated delivery date displays accurately again instead of showing an old cached date. I’m assuming this may have to do with the APO (Automatic Platform Optimization) feature which is keeping these delivery dates in static cache and not updating them when they change.

Which plugin is this?

Most likely, as you’re using a non-standard configuration. Post the plugin name and @yevgen will probably give it a look.

You can’t exclude from cache only part of the page: it’s either all or nothing.

I tried lowering the “Browser Cache TTL” to 1 hour, but the problem still occurs.

Instead of Browser Cache TTL you should set “Edge TTL” to < 24h. It’s explained here: Understanding Automatic Platform Optimization (APO) with WordPress – Cloudflare Help Center

UPDATE: Ah, now I get it. It has nothing to do with the shopper. It’s just regular cached data.

I have a plugin that inserts an estimated delivery date in Woocommerce product pages…

It probably works for anonymous users without any cookie.

Ah okay I honestly didn’t realize the important different with Edge TTL. So I’ve now created a page rule for my product pages with Edge TTL set to 1 hour, and I will see what happens. Regarding the plugin, it’s a paid plugin, link here (not sure if this helps but just in case). I thin you are right that it works for anonymous users without any cookie, because it sometimes shows me a current delivery date if I view in a different browser with incognito.

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