• Resolved ibro87

    (@ibro87)


    Hello,

    I noticed that entire cache is purged automatically every time anything is changed/saved on the site. For example, updating existing posts/pages and WooCommerce products, saving settings on any plugin, deactivating plugins, etc. How can I disable this?

Viewing 15 replies - 1 through 15 (of 19 total)
  • Plugin Support vupdraft

    (@vupdraft)

    Hi,

    Can you add the following code to your active theme’s functions.php file

    add_filter('wpo_purge_all_cache_on_update', '__return_false');

    Thread Starter ibro87

    (@ibro87)

    Hi,

    Thanks for sharing this filter. Unfortunately, this filter does not seem to work. When one WooCommerce product is updated the entire site cache is purged which does not make any sense.

    Is there anything else we can try to stop automatic purging of entire cache?

    Plugin Support vupdraft

    (@vupdraft)

    add_action('save_post', array($this, 'purge_post_on_update'), 10, 1);
    
    add_action('save_post', array($this, 'purge_archive_pages_on_post_update'), 10, 1);
    
    add_action('wp_trash_post', array($this, 'purge_post_on_update'), 10, 1);
    
    add_action('comment_post', array($this, 'purge_post_on_comment'), 10, 3);
    
    add_action('wp_set_comment_status', array($this, 'purge_post_on_comment_status_change'), 10, 1);
    
    add_action('edit_terms', array($this, 'purge_related_elements_on_term_updated'), 10, 2);
    
    add_action('set_object_terms', array($this, 'purge_related_elements_on_post_terms_change'), 10, 6);
    
    add_action('wpo_cache_config_updated', array($this, 'cache_config_updated'), 10, 1);
    
    add_action('wp_insert_comment', array($this, 'comment_inserted'), 10, 2);
    
    add_action('import_start', array($this, 'remove_wp_insert_comment'));
    
    add_action('update_option_page_on_front', array($this, 'purge_cache_on_homepage_change'));
    
    add_action('update_option_page_for_posts', array($this, 'purge_cache_on_blog_page_change'), 10, 2);
    
    add_action('woocommerce_variation_set_stock', array($this, 'purge_product_page'), 10, 1);
    
    add_action('woocommerce_product_set_stock', array($this, 'purge_product_page'), 10, 1);
    Plugin Support vupdraft

    (@vupdraft)

    The above is the plugins code, you could add any of these as a filter

    Thread Starter ibro87

    (@ibro87)

    Ok. So I’ve tried them all, but none of them worked. Every time the post / page or WooCommerce product is updated, the entire cache is purged which is unacceptable.

    FYI, adding this filter add_filter(‘cache_config_updated’); caused critical error on the site.

    Is there anything else we can do here to make caching functionality usable in this plugin?

    • This reply was modified 3 months ago by ibro87.
    Plugin Support vupdraft

    (@vupdraft)

    Hi,

    It doesn’t purge everything, just the related items terms, categories etc.

    Do you have minify enabled, can you try disabling it?

    Thread Starter ibro87

    (@ibro87)

    Hi,

    I do NOT want anything to be purged automatically. I have thousands of products on the website. Updating one single product purge them all including all other content on the website which makes caching pointless. Is there a fix for this?

    FYI, no minification is enabled in the plugin settings.

    Plugin Support vupdraft

    (@vupdraft)

    Did you try adding all filters for all of the above at the same time or did you try one at a time?

    Thread Starter ibro87

    (@ibro87)

    Hi,

    I tried adding one by one filter. Should I add them all at once?

    Plugin Support vupdraft

    (@vupdraft)

    Yes, you would need to add them all to stop all automatic purging.

    For example the first one purge_post_on_update, if you set it to false it would just stop a post’s cache being purged when a post is updated and not in any other circumstance.

    There are some woocommerce ones there that you are likely going to want to leave as, as an example, you would want your product quantities to be updated when you have made a sale.

    Thread Starter ibro87

    (@ibro87)

    Hi vupdraft,

    Thank you for your explanation. I totally get that every filter has its own functionality. So, I’ve added them all as suggested (see here please) but none of these filters seem to prevent automatic purging on the website.

    For example, when new WooCommerce product is added or updated on the website, entire purge automatically occurs for all the content on the website right after clicking on “Publish” / “Update” button.

    Am I missing something here?

    Plugin Support vupdraft

    (@vupdraft)

    I am just checking this with my colleague to see if they can suggest anything further.

    Thread Starter ibro87

    (@ibro87)

    Hi vupdraft ,

    Sounds good. Thank you!

    Plugin Support vupdraft

    (@vupdraft)

    Can you try adding the following: add_filter(‘wpo_purge_cache_hooks’, ‘__return_empty_array’);

    Thread Starter ibro87

    (@ibro87)

    Hi vupdraft,

    Thanks for your effort and willingness to help. Unfortunately, this filter does not work either. Is there anything else we can try to make this work?

Viewing 15 replies - 1 through 15 (of 19 total)
  • You must be logged in to reply to this topic.