I need your help to setup proper page rules for may wordpress woocommerce store as I am facing a problem of cached API calls of the plugin called “best upsell”.
The best upsell plugin developers stated that the API Call to the URL " ```
MYDOMAIN/wp-json/wc/v3/cartdata
In the enclosed screen shot, you'll find my current page rule settings.

Please help to setup the best matching page rules for a optimized secure and fast page performance to use my woocommerce shop without problems, as well not to cache dynamic content + neccessary API calls.
Best regards,
Alex
P.S. For the testing & resolving purpose I am running now a "clone.mydomain" site and at the main "www.mydomain" site, this plugin is inactive set until it is running on the clone site properly.
I need your help to setup proper page rules for may wordpress woocommerce store as I am facing a problem of cached API calls of the plugin called “best upsell”.
The best upsell plugin developers stated that the API Call to the URL “MYDOMAIN/wp-json/wc/v3/cartdata” is cached, which should not. Therefore the proper setup of page rules should be used to exclude API calls.
In the enclosed screen shot, you’ll find my current page rule settings.
Please help to setup the best matching page rules for a optimized secure and fast page performance to use my woocommerce shop without problems, as well not to cache dynamic content + neccessary API calls.
Best regards,
Alex
P.S. For the testing & resolving purpose I am running now a “clone.mydomain” site and at the main “www.mydomain” site, this plugin is inactive set until it is running on the clone site properly.
Thank you for sharing a screenshot of your Page Rules.
However, unfortunately from your shared screenshot, the 2nd and 3rd rule wouldn’t work at all as that syntax is not supported in Page Rules (the pipe | or operator like using regex or).
I wonder if that’s a JSON response or output , if so, you could remove the 2nd and 3rd Page Rule and create a new one with matching *2buy.xyz/wp-json* and Cache Level: Bypass. Would be like:
Otherwise, for a particular match, using a Transform Rules → Modify Response Header and adding the HTTP cache headers to disable caching it, would be like:
My page rule setting is now (screenshot enclosed):
1 rule (untouchted) 2buy.xyz/wp-content/uploads
Browser Cache TTL: a year, Cache Level: Cache Everything, Edge Cache TTL: a month
2 rule (according your advice) 2buy.xyz/wp-json
Cache Level: Bypass
3 rule (is paused and in need to get more explained as I got the info to set this up from this CF article ( support(dot)Cloudflare(dot)com/hc/en-us/articles/236166048-Caching-Static-HTML-with-WordPress-WooCommerce) and want to make sure that this is also proper working) .2buy.xyz/|checkout/|cart/|my-account/*
Cache Level: Bypass, Edge Cache TTL: a month
PS. Unfortunately the selection of the above stated article to “Bypass Cache on Cookies” is not available any more in the page rules. Any ideas how to set this up according the article suggested?
Yes, this ain’t going to work because the syntax not good.
For that kind of a feature, you’d have to be on at least the Business plan:
Business and Enterprise customers can bypass HTML caching when a cookie is sent with a request Bypass Cache on Cookie setting using Cloudflare Page Rules.