bugmagnet
bugmagnet

Reputation: 7769

How to do I purge the LiteSpeed cache using WordPress's REST API?

I'm communicating with a WordPress site's REST API with RestSharp. I've authorised myself to the client's website and issued a GET to https://REDACTED/wp-json/litespeed/v1/ping. I've received a promising looking response: {"ver":"5.3.2","_res":"ok"}.

Now, how do I now trigger a purge_all?

Upvotes: 1

Views: 558

Answers (1)

qtwrk
qtwrk

Reputation: 349

well , the answer is no , LiteSpeed Cache plugin doesn't have REST endpoint for purge event

best you can is use code snippet to add your own custom REST endpoint , something like /wp-json/mycustom/purge_all

and hook it to do_action( 'litespeed_purge_all' ); action for purge all

Upvotes: 1

Related Questions