• Resolved Sn00z389

    (@webmakers2011)


    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,

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support qtwrk

    (@qtwrk)

    Hi,

    Since you are using API to update inventory, I’d also suggest you to add purge API during process.

    https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:api

    Best regards,

    Thread Starter Sn00z389

    (@webmakers2011)

    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.

    Plugin Support LiteSpeed Lisa

    (@lclarke)

    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, it’s 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 it’s just for a few minutes.

    Hope this helps! Let us know if you need any further information.

    Thread Starter Sn00z389

    (@webmakers2011)

    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,

    • This reply was modified 6 years, 6 months ago by Sn00z389.
    Plugin Support LiteSpeed Lisa

    (@lclarke)

    That is a much simpler solution ??
    Glad to hear everything is OK now!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Woocommerce Inventory Stock not Updating’ is closed to new replies.