Support Forums

Support Forums Forums Search & Filter Pro Rebuild cache on cron

This topic is: not resolved
Viewing 8 posts - 1 through 8 (of 8 total)
  • Dean Claydon


    I am wondering if there is a way that we can rebuild the cache automatically on a cron job every evening.

    Currently, I am using do_action('search_filter_update_post_cache', $post->ID); in a foreach loop that updates at midnight every day. However, this does not appear to rebuild the cache and the posts are not displaying on the filter.

    Is there any advice you can give please?

    We are using 2.4.6 version of the plugin.

    Trevor Moderator
    This reply has been marked as private.
    Dean Claydon

    Hello Trevor,

    Thank you for your reply.

    We have been busy trying to resolve our issue, however we are not much further unfortunately.

    I have seen in the documentation that you can use do_action('search_filter_update_post_cache', $postId); to update the post cache.

    To check that this has worked in our function, we are using:

    if (did_action('search_filter_update_post_cache') === 1) {
                        echo 'it worked';
                    } else {
                        echo 'its broken';

    And everytime it prints out “It worked”

    However, unfortunately the post is not showing in our custom post type.

    I have tried the WP_Query loop that is in the documentation as well as the get_queried_object() loop.

    Do you have any ideas what we are missing please?

    Kind regards,


    Trevor Moderator

    Immediately after you import the post, if you know the Post ID, go look in our cache table to see if it is there?

    Dean Claydon

    I have taken a look in the cache table and I can see it there, with the updated field values.

    We are not importing any post, in fact we are updating the post.

    I am a bit lost here now, and hope you can help please.

    Trevor Moderator

    And are the new values stored there?

    Dean Claydon
    This reply has been marked as private.
    Trevor Moderator

    And yet, when you do a search, those fields are wrong? I ask because our filter uses that cache table. Something sounds very wrong. If it is correct in the cache table, it should show like that in the results. Only some form of server/WordPress page caching (unrelated to our plugin) would stop this from being the case.

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.