Unhook to disable Purge on commeno




Wordpress LScache Plugin: Unhook to disable Purge on commeno

Last Updated on: Wed, 15 Apr 2026 00:00:02
Hi guys, First of all ofcourse a big thanks for your work! Ive been looking for a way to disable the page Purge on a new comment but I dont seem to find the right hook. Could you help me out in this? FYI: my client is using Disqus on their site and at some moments they have up to a hundred comments a minute on one post. Since Disqus is always showing the recent comments on page load there is no need to Purge the post (or homepage). I now how to hook into the Disqus comment sync. But not how to disable the actual Purge. Thanks in advance for any suggestions. Regards, Niels Hi, I just tried with WP default theme + disqus Which based on my test , comment does NOT purge the page. Could you please provide the report number ? Can I do some comment on your site to check ? Best regards, Thank you for getting back to me that quickly. I will have to see with the client if I can give you access, but Im afraid not. Ive just submitted a report (QBVOEVGS), maybe that helps. Ive also uploaded the debug.purge.log that can be viewed here: https://pastebin.com/RBvqdP38 (changed the userid and domainname) Ive tried to understand it, but didnt get everything, so maybe that could tell you more about why the posts get purged more often then needed. The posts really only need to be purged on publish or update for them. I can purge the homepage with a cron (like we do for some other custom pages already). Big thanks! PS: If you mean by do a comment, posting a comment (had to read it twice), yes of course. But best not to do it on the most recent artikels. Re-hi, What I forgot to mention, before switching to LSCache I used WP-Rocket and at that time I had the following to disable cache purge on comment sync: remove_action(clean_post_cache, rocket_clean_post ) remove_action(wp_update_comment_count, rocket_clean_post ) So looking for kind of the same solution, but there Im stuck. Hi, I see you are using OpenLiteSpeed. So I set up server with OpenLiteSpeed and try to reproduce the issue. But it doesnt happen on my test site either, I made some comment on disque but doesnt trigger purge on the page. I then compared the LSCWP setting from report against my site. I did notice some different , could you please try reset it to default and see how it goes ? Best regards, Ive just done a reset (only re-enabled logging), but it didnt change anything. First comment sync and directly a purge. Did you enable comment syncing in your test installation? Its not the comment itself causing the purge but the sync thats done through the WP REST API. 07/23/19 18:07:24.729 [208.101.7.43:54152 1 nZj] ------POST HTTP/1.1 (HTTPS) /wp-json/disqus/v1/sync/webhook 07/23/19 18:07:24.729 [208.101.7.43:54152 1 nZj] Query String: 07/23/19 18:07:24.729 [208.101.7.43:54152 1 nZj] LSCACHE_VARY_COOKIE: wp-postpass_ffa8c56742b72057e9da18b5138edec1 07/23/19 18:07:24.729 [208.101.7.43:54152 1 nZj] X-LiteSpeed-Purge: public,stale,aa2_Po.25446,aa2_URL.08fbfda29cdd4ef2683e3ae25a0e89ef,aa2_W.recent-posts-1,aa2_Po.25430,aa2_T.4434,aa2_T.4332,aa2_T.4059,aa2_T.4232,aa2_T.3672,aa2_T.4035,aa2_T.3778,aa2_T.10247,aa2_T.7173,aa2_T.18113,aa2_T.4529,aa2_T.18112,aa2_T.5648,aa2_T.7761,aa2_T.8133,aa2_T.18109,aa2_T.4637,aa2_T.4552,aa2_T.18107,aa2_T.18111,aa2_T.4579,aa2_T.4648,aa2_T.7711,aa2_T.18110,aa2_T.18108,aa2_T.4633,aa2_T.4650,aa2_A.34,aa2_PT.post,aa2_F,aa2_H,aa2_PGS,aa2_PGSRP,aa2_D.201907,aa2_REST => LSC->send_headers()@680 => WP_Hook->apply_filters()@286 => WP_Hook->do_action()@310 => /home/public_html/wp-includes/load.php@465 07/23/19 18:07:26.359 [208.101.7.44:27692 1 WBy] ------POST HTTP/1.1 (HTTPS) /wp-json/disqus/v1/sync/webhook 07/23/19 18:07:26.359 [208.101.7.44:27692 1 WBy] Query String: 07/23/19 18:07:26.359 [208.101.7.44:27692 1 WBy] LSCACHE_VARY_COOKIE: wp-postpass_ffa8c56742b72057e9da18b5138edec1 07/23/19 18:07:26.359 [208.101.7.44:27692 1 WBy] X-LiteSpeed-Purge: public,stale,aa2_Po.25446,aa2_URL.08fbfda29cdd4ef2683e3ae25a0e89ef,aa2_W.recent-posts-1,aa2_Po.25430,aa2_T.4434,aa2_T.4332,aa2_T.4059,aa2_T.4232,aa2_T.3672,aa2_T.4035,aa2_T.3778,aa2_T.10247,aa2_T.7173,aa2_T.18113,aa2_T.4529,aa2_T.18112,aa2_T.5648,aa2_T.7761,aa2_T.8133,aa2_T.18109,aa2_T.4637,aa2_T.4552,aa2_T.18107,aa2_T.18111,aa2_T.4579,aa2_T.4648,aa2_T.7711,aa2_T.18110,aa2_T.18108,aa2_T.4633,aa2_T.4650,aa2_A.34,aa2_PT.post,aa2_F,aa2_H,aa2_PGS,aa2_PGSRP,aa2_D.201907,aa2_REST => LSC->send_headers()@680 => WP_Hook->apply_filters()@286 => WP_Hook->do_action()@310 => /home/public_html/wp-includes/load.php@465 07/23/19 18:07:40.663 [208.101.7.44:56996 1 BqJ] ------POST HTTP/1.1 (HTTPS) /wp-json/disqus/v1/sync/webhook 07/23/19 18:07:40.663 [208.101.7.44:56996 1 BqJ] Query String: 07/23/19 18:07:40.663 [208.101.7.44:56996 1 BqJ] LSCACHE_VARY_COOKIE: wp-postpass_ffa8c56742b72057e9da18b5138edec1 07/23/19 18:07:40.663 [208.101.7.44:56996 1 BqJ] X-LiteSpeed-Purge: public,stale,aa2_Po.25446,aa2_URL.08fbfda29cdd4ef2683e3ae25a0e89ef,aa2_W.recent-posts-1,aa2_Po.25430,aa2_T.4434,aa2_T.4332,aa2_T.4059,aa2_T.4232,aa2_T.3672,aa2_T.4035,aa2_T.3778,aa2_T.10247,aa2_T.7173,aa2_T.18113,aa2_T.4529,aa2_T.18112,aa2_T.5648,aa2_T.7761,aa2_T.8133,aa2_T.18109,aa2_T.4637,aa2_T.4552,aa2_T.18107,aa2_T.18111,aa2_T.4579,aa2_T.4648,aa2_T.7711,aa2_T.18110,aa2_T.18108,aa2_T.4633,aa2_T.4650,aa2_A.34,aa2_PT.post,aa2_F,aa2_H,aa2_PGS,aa2_PGSRP,aa2_D.201907,aa2_REST => LSC->send_headers()@680 => WP_Hook->apply_filters()@286 => WP_Hook->do_action()@310 => /home/public_html/wp-includes/load.php@465 Expand Hi, OK, could you please join our slack ? Id like to ask you to help me to reproduce the issue. Best regards, Ofcourse, just created an account. But not sure what to do next? After some investigation by @CacheCrawler we found the solution. For those interested to disable all purges called by the disqus comment sync you can use the following: if( !function_exists(is_plugin_active) ) include_once( ABSPATH . wp-admin/includes/plugin.php ) add_action( rest_api_init, disable_disqus_purge ) function disable_disqus_purge() if(is_plugin_active(litespeed-cache/litespeed-cache.php) AND is_plugin_active(disqus-comment-system/disqus.php) AND strpos($_SERVER[ REQUEST_URI ],wp-json) AND strpos($_SERVER[ REQUEST_URI ],disqus)) remove_action( edit_post, LiteSpeed_Cache_Purge::purge_post ) remove_action( wp_update_comment_count, LiteSpeed_Cache_Purge::purge_feeds ) This would prevent the homepage, post and feeds to be purged when disqus comments are syncing. In case you still want to purge the feeds you can remove: remove_action( wp_update_comment_count, LiteSpeed_Cache_Purge::purge_feeds ) from the code above. By using a cronjob you could also purge the posts or frontpage for example with specific intervals (thats my solution). But thats to much detail this question is answered. Big thanks to @CacheCrawler !



LiteCache Rush: Speed comes from using less, not from doing it faster



Reference