litespeed_purge_all with REST API




Wordpress LScache Plugin: litespeed_purge_all with REST API

Last Updated on: Wed, 15 Apr 2026 00:00:02
I want to setup a REST endpoint to purge everything. Im trying this inside of functions.php, but it does not seem to work. It does seem to get something because after I login to the backend it seems to have cleared it, but not before. ... register_rest_route( ppt/v1, /purge, array( methods => GET, callback => purge_cache, )) ) function purge_cache() do_action(litespeed_purge_all) return array(status => success) I saw in other threads that something like wp-load.php was imported, could that be related to the issue? Hi, function my_purge() do_action( litespeed_purge_all ) return array(status => success) add_action( rest_api_init, function () register_rest_route( purge/v1, /purge_all, array( methods => GET, callback => my_purge, ) ) ) goes to themes funcitons.php then by https://domain.com/?rest_route=/purge/v1/purge_all tested and confirmed working on my site just make sure you did NOT cache the WP REST , otherwise only first access will call to purge , afterwards, since it is cached, it wont trigger the purge Best regards, Oh yes, I fell into a little bit of circular logic. I want to cache my REST APIs, since Im using it quite extensively via React. Is there a way not to cache that route in particular? I excluded my purge API route in the settings and now it works fine, thanks!



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



Reference