• Hi, I have more than 10 sites created using this plugin and I haven’t been able to solve this problem for a long time and every day I have to check if everything is ok!

    It doesn’t seem right anymore than a plugin so it seems like slavery

    back in the posts I found a code that rebuilds the cache via cron job. this code doesn’t seem to work by blocking streaming but the idea was good and it might work

    I paste the code below and I warmly thank whoever created it. let’s find a solution together??? thank you all!!!

    Last chance, then we’ll officially change plugins for all my clients and goodbye to slavery!!!!

    <?php
    register_activation_hook(__FILE__, 'custom_cache_clear_activate');
    
    function custom_cache_clear_activate() {
        my_custom_cache_clear_event();
    }
    
    function my_custom_cache_clear_event() {
        $task = 'flow_flow_load_cache_clear';
    $frequency = 'hourly';
    
    
        add_action($task, function () {
            global $wpdb;
            $wpdb->query($wpdb->prepare('DELETE FROM '.$wpdb->prefix.'ff_posts'));
            $wpdb->query($wpdb->prepare('DELETE FROM '.$wpdb->prefix.'ff_post_media'));
        });
    
        if (!wp_next_scheduled($task)) {
            wp_schedule_event(
                strtotime(date('Y-m-d H:00:00', strtotime('now + 1 hour'))),
                $frequency,
                $task
            );
        }
    }
    
    add_action('init', 'my_custom_cache_clear_event');
    

Viewing 1 replies (of 1 total)
  • mapsmarketing

    (@mapsmarketing)

    /**
     * Flow-Flow social plugin rebuild cache when the below URL is visited
     */
    function flow_flow_init() {
        if (isset($_GET['ff']) && $_GET['ff'] == 'rebuild-cache' ) {
            flow_flow_rebuild_cache();
        }
    }
    function flow_flow_rebuild_cache() {
        global $wpdb;
    
        $wpdb->query($wpdb->prepare('DELETE FROM '.$wpdb->prefix.'ff_posts'));
        $wpdb->query($wpdb->prepare('DELETE FROM '.$wpdb->prefix.'ff_post_media'));
    }
    add_action( 'init', 'flow_flow_init' );

    In cPanel you can create a Cron Job now which runs https://example.com/?ff=rebuild-cache to rebuild the cache at any period you like.

Viewing 1 replies (of 1 total)
  • The topic ‘Can we solve the rebuild cache problem automatically?’ is closed to new replies.