• Resolved lukas22

    (@lukas22)


    Hello,
    I need to refresh the static page cache every time a new order appears in the database. Can you help me with that how to set up?
    Thank you.
    Have a nice day.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hello,

    Which plugin manages your orders?
    Also do you want to clear the whole cache, or only a certain product’s page?

    The functions wpo_cache_flush() and WPO_Page_Cache::delete_single_post_cache($post_id); are available after plugins_loaded, so you could hook when a new order is recorded and clear what you need to.

    Thread Starter lukas22

    (@lukas22)

    Hello,

    Orders managed by “RnB – WooCommerce Booking & Rental Plugin” basically the original WooCommerce database. And I’d like to delete only one page cache and then add it. ??
    Thank you for your response. I’m still thinking how to run it only when an order record is made. ??

    Lukas

    This will require a bit of coding, but thankfully Woocommerce has hooks for everything: https://docs.woocommerce.com/wc-apidocs/hook-docs.html, so this should be possible without too much problems.

    Thread Starter lukas22

    (@lukas22)

    The code from you to clear the cache helped me, is there some code to make a new cache?
    Thank you ??

    You should be able to use
    WP_Optimize_Page_Cache_Preloader::instance()->preload_desktop('your url');

    If you have the $post_id from before, you might be able to replace ‘your url’ by get_permalink($post_id);

    Thread Starter lukas22

    (@lukas22)

    Thank you very much. ??
    It’s a big help for my website. ??

    Hi, I have an RSS aggregator plugin running on my website which displays its output onto a single page. As the feed refreshes it is not being picked up by the cache. Is there a way that this can be changed? Thanks for any help. https://www.buckinghamcameraclub.co.uk/photography-news-tips/

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘A cache that depends on inserting or deleting a table entry in a database’ is closed to new replies.