• Resolved dailce

    (@dailce)


    I saw someone mention
    do_action('litespeed_purge_private', 'user_' . $user_id);
    To clear a users private cache I know wp rocket offers this features, it seems like it would be easy to implement?

    Is there a way to clear a specific users cache yet or no? Are there plans to add this in the future?

    Thanks.

Viewing 1 replies (of 1 total)
  • Plugin Support qtwrk

    (@qtwrk)

    not natively , but you can try this approach

    function add_user_cache_tag() {
    if ( is_user_logged_in() && defined('LSCWP_V')) {
    $user_id = get_current_user_id();
    do_action( 'litespeed_tag_add', 'user_id_' . $user_id );
    }
    }

    add_action( 'init', 'add_user_cache_tag' );

    this will assign user id tag , like user_id_123 where 123 is the user ID that visited it

    then later on , you can do do_action( 'litespeed_purge', 'user_id_' . $user_id );

    to purge it

Viewing 1 replies (of 1 total)

The topic ‘Clear cache per user?’ is closed to new replies.