Forums Forums Search & Filter Pro Rebuild Cache in background and swap it after it has been created

Viewing 10 posts - 1 through 10 (of 28 total)
  • Trevor
    #235993

    You should be able to use a filter in WP All Import to do this.

    Add something like this in the child theme functions.php file:

    add_action('pmxi_saved_post', 'wp_all_import_post_saved', 1000, 1);
    
    function wp_all_import_post_saved($id) {
        do_action('search_filter_update_post_cache', $id);
    }

    Do a test import of a post and see if it has been added to the cache.

    Anonymous
    #236217
    This reply has been marked as private.
    Trevor
    #236219

    The code updates the cache/index only for the added/changed products, not the whole cache. It does it one product at a time, which is the way the importer works (it doesn’t bulk import all products in one database write, it does it one at a time).

    Anonymous
    #236221

    Sounds great!
    Thanks Trevor!

    Trevor
    #236223

    I will leave this open for you to try, if you could get back to me to confirm if it works?

    No need to reply now though, unless you have already tested it.

    Anonymous
    #239469
    This reply has been marked as private.
    Trevor
    #239473

    Did you use an import plugin? If so, was it WP All Import? Otherwise, I am impressed with your typing speed 😉

    Anonymous
    #239491
    This reply has been marked as private.
    Trevor
    #239499

    This post might therefore be relevant:

    https://support.searchandfilter.com/forums/topic/cache-building/#post-238754

    For now, you will need to trigger a manual cache build from the form design/edit page in admin. The button is on the top right of the edit page.

    Anonymous
    #239886
    This reply has been marked as private.
Viewing 10 posts - 1 through 10 (of 28 total)