Hello everyone,
We have Point of sales system connected to Woocommerce api.
When every Point of sales system pushes inventeroy changes my inventory is not getting updated. I ask the point of sale team they said its something to do with cache plugin. I am using WP rocket they said from there end every thing is fine.
Point of system developer told me to do this.
(See if you can add an exclusion for woo commerce api. Don’t cache anything in url that has wp-json)
If any one can help me with this issue that will be great.
Cloudflare won’t cache your /wp-json.php by default. You’d need to have a page rule with a Cache Level of “cache everything” for that to happen.
Assuming you have a cache everything page rule for your whole domain, if you want to exclude the /wp-json.php you could create another page rule, and place it above the cache everything rule so that it triggers first (just one page rule triggers for any given URL in a visit)
URL: /wp-*
Settings:
Disable Apps
Rocket Loader OFF
Security Level: High
The above rule would not only prevent /wp-json.php from being cached, but also /wp-login.php and anything under /wp-admin/.
p.s.: I don’t think this topic belongs to Developers > API, as it has nothing to do with the Cloudflare API.
Static files under /wp-content/ would still be cached, if the settings are the ones I mentioned.
The trick here is NOT adding “Cache Level: Bypass”, as non-static cache will be bypassed anyway by the mere position of this rule before the “cache everything” one.
Thank you, for your help i will find out tomorrow if that work or not
I am using the woocommerce social login (facebook and google) Both have stop working since wp rocket and Cloudflare. Any idea how to fix that
Please check the screenshot
My suggestions above where based on your initial information that you were told to avoid caching wp-json.php. However, I don’t know much about woocommerce, and wouldn’t be able to help you with this new issue.
Also, if the caching issue isn’t solved, you may need to remove the cache everything page rule altogether, and perhaps adopt a solution that uses both a WP plugin and a Cloudflare Workers to cache everything when the user is not logged in, but not cache when the user is logged in.