• Resolved idovecer

    (@idovecer)


    Hello,

    #1: my php script updates prices and quantities for some products and variation products. After updating prices and quantities, I found it easiest to run w3tc_flush_all() and delete all cache.

    The problem is that the page runs slowly afterwards because all the cache is cleared. So, my idea is to flush only the updated variable products as well as their parents and all categories and tags in which that product appears.

    What command should I use?

    #2: When a visitor initializes the caching of a page, it becomes cached. How long is the page cached for another visitor?
    Tnx.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @idovecer

    Thank you for reaching out and I am happy to assist you with this.

    You can purge the individual page/post while logged in to your wp-admin area and checking the page you wat to purge. In the top admin bar, however over Performance and click the Purge current page.

    Alternatively, you can use more programmatical approach. So you can ?hook onto the post-update hook, fetch all posts in the same tag/category and call w3tc_flush_url($url) on those posts.
    I hope this helps.

    Thread Starter idovecer

    (@idovecer)

    How does W3TC know which product to flush when accessing a product? Does it check the last modification date or something else? Is it enough to just change the post_modified field?

    Regarding WooCommerce, are transients in any way related to W3TC caching? Are they also cached by W3TC?

    Specifically, I am interested in whether I need to manually flush the cache for the post_id and all URLs, tags, and categories associated with it in my code, or is it sufficient to just change the post_modified field and let W3TC handle it the next time a user accesses it?

    Thank you one more time.
    BR.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @idovecer

    We are working on multiple solutions for Woocomerce and one of the solutions is exactly the one you are mentioning and which is updating prices and quantities for some products and purging the specific cache.

    At the moment, W3TC cannot purge the cache when this is updated in the backend, so we are working on a hook that will purge the cache for a specific page/product. For the time being, the only solution is a manual purge of the cache or purging all cache with a hook.

    As for the transients, you can use Object Cache for this, just note that you should use memory-based caching like redis or memcached.

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Manually flush product page and categories’ is closed to new replies.