Refreshing the cache when commenting on an article




Wordpress LScache Plugin: Refreshing the cache when commenting on an article


Hello, We have a site with LightSpeed Cache installed. Our Purge settings are like here. According to this, when a new article is published or updated, the cache of all category and tag pages belonging to the article is refreshed. We receive a lot of comments on published articles. We use the WPDisquz plugin for comments on our site. The caches of the pages I mentioned above are renewed after each comment and/or liking made to the article. Due to the subject of the articles published on our site, an article contains more than one category and tags. Refreshing this many pages each time a comment is made or a comment is liked slows down the displaying of these pages. Can you suggest a solution for this? Thanks in advance for your interest and help. Best regards. LiteSpeed Report number: ALONAEEV The page I need help with: https://www.arthenos.com/ Hi, please try add this into your themes functions.php add_action( wpdiscuz_after_comment_post , function ($newComment, $currentUser) $post_id = $newComment->comment_post_ID ob_start( function($buffer) use ($post_id) @header( X-LiteSpeed-Purge: . LSWCP_TAG_PREFIX . _Po. . $post_id ) return $buffer ) 10, 2) this should suppress all other purges but only to the post itself Best regards, Hi, The problem was solved with the code you sent. Thank you. Best regards.