• Resolved Sebastian

    (@sebastianulbert)


    Has there been made any changes to
    LiteSpeed_Cache_API::purge_post( $_REQUEST['post_id'] );
    in the new update? It’s not purging the cache for a single page anymore.

    I used this for a love it button which readers could hit as often as they wanted.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • From the new documentation, it looks to be

    do_action( 'litespeed_purge_post', 'post_id' );

    From my testing, the only problem is it seems to purge the whole cache rather than the specified post ID.

    It would be good if you can confirm it’s not just me.

    Thread Starter Sebastian

    (@sebastianulbert)

    Thanks @luminsol pointing me to the new documentation.

    do_action( 'litespeed_purge_post', ( $_REQUEST['post_id'] ));
    did it for me. In my case it does what’s promised and only purges the specific post.

    Thanks for confirming @sebastianulbert.

    I managed to track down the issue. If you have Auto Purge Rules For Publish/Update enabled, it will purge all those pages as well.

    They should really document that this is a side effect of the litespeed_purge_post API. Looking at the documentation alone, you would think it would ONLY purge the single post ID.

    Hope this helps someone in the future!

    Hi
    it doesn’t seem to work in my case
    do_action( 'litespeed_purge_post', $parent_id );

    It does not purge the post defined by its id.
    Worth to notice that the post is a custom post type, which might be the problem.

    (I have applied pure ALL for now, which is super overkill ./ )

    • This reply was modified 4 years, 9 months ago by 2046.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Purge single page cache’ is closed to new replies.