How to limit Automatic Cache Clearing to only Blog Posts, excluding all Custom Post Types? WooCommerce site

Hi,

Comet Cache Pro has slowed our high traffic WooCommerce site to a crawl, unfortunately.

Is there a way to tell Comet Cache to Automatically Clear Cache ONLY for posts, not any custom post type?

Here is why.

In NewRelic we’ve identified the slowness seems to be that when new orders are created or any of our WooCommerce custom post types update, Comet Cache appears to delete cache. MANY times. Sometimes 15 times or more from a single WooCommerce order being placed. Here’s a screenshot from NewRelic of one such WooCommerce order: https://cloudup.com/cetYbv4l_Qz

Also when our orders get imported by Shipstation (our shipping service) it results in cache being deleted in this case up to 43 times for a single transaction. See: https://cloudup.com/cbHXVDjN0zZ

We update a lot of fields in the database when WooCommerce creates an order: sending emails, changing inventory, creating custom orders etc. Through various plugins with probably custom post types.

How can we limit Comet Cache to Automatic Cache Clearing only for blog posts? Excluding WooCommerce’s and any other custom post types?

We think this may vastly speed up our site.

Thanks for any advice!

Hi Scott.

How can we limit Comet Cache to Automatic Cache Clearing only for blog posts? Excluding WooCommerce’s and any other custom post types?

Have you tried the URI exclusions? WP Admin > Comet Cache > URI Exclusions

I hope that helps! :slight_smile:

Thanks Cristian!

URI Exclusions will let us tell Comet Cache that a particular URL should never be cached, but that’s not really what we need. What we are looking to do is to tell Comet Cache that cache for archive pages, the home page, etc should be updated on post save, but only when the post type is ‘post’ or ‘page’. What we see now is that when we have those settings turned on under Automatic Cache Clearing, any change to any post type will trigger Automatic Cache Clearing.

Our custom post types – added by WooCommerce – include:

shop_order
shop_subscription
shop_coupon
shop_order_refund

We’d like Comet Cache to not clear cache when those custom post types are created or updated.

For example, an order is placed (saved as a CPT), Comet Cache clears the home page cache, cache is locked/rebuilt. There’s no need for the cache to be cleared when an order is placed because there are no forward-facing components on the site that reflect orders for logged out users. However, if we disable Automatic Cache Clearing entirely, then saving a post/page will require a manual flush of cache on several pages. Ideally, there would be a filter hook that we could use to specify post types that should not trigger Auto Cache Clearing.

1 Like

Gotcha.

I see what you mean. I’m adding Post Type Exclusions to the feature requets list. I think it’s a great idea. :slight_smile:

In the mean time, if you could give those post types something in their URLs to tell them apart, the URI Exclusions may help you.