• Resolved jezkerw

    (@jezkerw)


    Is it possible to set so that the cache is flushed on specific individual pages when a comment is added to that page or some other element changes (without actually hitting the edit button). I use Content Views Pro to display thumbnails/links in certain posts, so often new thumbnails are automatically added but the page cache is not flushed and I have to do it manually. I want to avoid flushing cache for ALL pages.

    Thanks.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support qtwrk

    (@qtwrk)

    if that content views pro has some hook that is fired when something is changed, then you can call our purge API when it happens.

    Thread Starter jezkerw

    (@jezkerw)

    Ok, nice 🙂

    Thread Starter jezkerw

    (@jezkerw)

    Hi @qtwrk they responded to me:

    “The cache is stored by LSCache plugin. Our plugin doesn’t store any cache. So this is out of our control.

    The LSCache plugin should clear its cache whenever a new post is added. Please ask their support if there is any code snippet to clear the cache automatically whenever a new post is added.”

    Plugin Support qtwrk

    (@qtwrk)

    by default when transition_post_status is triggered , plugin will purge cache

    ref: https://github.com/litespeedtech/lscache_wp/blob/9a2ffc900478312399ac5f291197e741bb4716c2/src/purge.cls.php#L68C15-L68C37

    if they have some action to fire at their side , you can hook it with our purge API, just exemplary code , assuming the $post_id will be passed in.

    add_action( 'imaginary_action_name', 'lscwp_purge_post' );
    
    function lscwp_purge_post()
    {
      if (defined('LSCWP_V')){
        do_action( 'litespeed_purge_post', $post_id );
      }
    }
    Thread Starter jezkerw

    (@jezkerw)

    Hi @qtwrk

    There is no way to just enter a url somewhere in the cache plugin to instruct it to clear cache on that page when it’s updated? I dunno, it feels like I’m just going to be sent back and forth here lol.

    Thread Starter jezkerw

    (@jezkerw)

    By the way, I don’t have “auto purge” on for all pages. I only have it for the front page if that makes a difference.

    Thread Starter jezkerw

    (@jezkerw)

    Having thought about it, I actually think checking the “auto purge all pages” is the best approach here as there are several pages that do not get updated when a new game is added to the Content Views.

    Would this be the best approach or do you recommend something else? 🙂 I guess ultimately what I was trying to do was to avoid clearing cache on pages that don’t need to be cleared.

    Thread Starter jezkerw

    (@jezkerw)

    Maybe I can clear selected pages based on tag/category or keyword?

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