How do I purge cahce for some custom data that I show ?

#1
I have a Digital Ocean Server, with openlitespeed droplet installed on it. I also have installed the litespeed plugin in my WordPress install. This is a custom woocommerce project where people come and buy meetings which are time-sensitive events.

I am facing issues with able to cache my code in order to provide them with real-time data. I have researched and found that ESI shortcodes are the way forward but I am not using Quic Cloud nor I have an enterprise server.

The next solution that I got was to call an API to purge the data of the page not really "puching hole in the page" but bearable. I have implemented the following:

PHP:
add_action( 'init', 'add_header_xua' );

function add_header_xua() {
   header("X-LiteSpeed-Purge: *");
}

I have also tried this with send_headers action. But it doesn't seem to solve my problem.

Also, I have switched off the private cache ,but I would like to turn it on if I get a working solution for this.
 
Top