Woocommerce Inventory Stock not Updating




Wordpress LScache Plugin: Woocommerce Inventory Stock not Updating

Last Updated on: Wed, 15 Apr 2026 00:00:02
Hi, we are using your plugin on all of our websites and it is running great, so far. However there is a problem with one of our websites, which is connected trough API to another website to update the inventory stock qty automatically via POST requests. The problem is that the inventory stock qty is not being updated until I purge all the cache. Is it possible to make the inventory stock qty field on the product page non-cacheable, so that the stock is updated accordingly, without the need to purge the page manually? Thank you, Best Regards, Hi, Since you are using API to update inventory, Id also suggest you to add purge API during process. https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:api Best regards, Hi, I red the suggested page, but I cannot find out how to make the inventory update accordingly or make it non-cacheable? Also I cannot manage to find out these settings in the LSCache plugin? Hello, For the ESI settings go to wordpress admin -> Litespeed cache -> Settings -> click on Advanced view -> ESI tab. Hi, @webmakers2011 Are you still having trouble with this? What Tishu is suggesting is that you turn the inventory field into an ESI block. ESI blocks can be cached differently than the rest of the page. That way, you can keep the majority of the page cached, but the inventory field would be uncached and always up to date. You can learn more about ESI on our blog, and then use that API link Tishu shared in order to set it up in your theme. One suggestion, though: any time you have uncached content on a page, its going to slow that page down considerably. The biggest benefit to caching is that PHP does not have to be invoked when a page is served, but if you have uncached blocks on your page, you lose that benefit. If your shop can handle a slight delay in stock status information, I would recommend caching the inventory field, even if its just for a few minutes. Hope this helps! Let us know if you need any further information. Hi @lclarke, I have managed to fix the problem by changing the WooCommerce settings to not show the quantity in stock on the product page. And now it is working fine, since when the API sends a POST request it updates the stock inventory in the backend and everything is working OK with it. Thank you for your support! Best Regards, That is a much simpler solution Glad to hear everything is OK now!



LiteCache Rush: Speed comes from using less, not from doing it faster



Reference