| @@ -1,21 +1,27 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if ( !class_exists( 'MeowCommon_Issues' ) ) { | |
| 3 | +if ( !class_exists( 'MeowKit_MGL_Issues' ) ) { | |
| 4 | 4 | |
| 5 | - class MeowCommon_Issues { | |
| 6 | - | |
| 5 | + class MeowKit_MGL_Issues { | |
| 7 | 6 | public function __construct( $prefix, $mainfile, $domain ) { |
| 8 | 7 | $this->check_plugins(); |
| 9 | 8 | } |
| 10 | 9 | |
| 11 | - function check_plugins() { | |
| 12 | - if ( class_exists( 'LiteSpeed\Core' ) ) { | |
| 13 | - $this->check_litespeed(); | |
| 10 | + public function check_plugins() { | |
| 11 | + | |
| 12 | + // Previous technique to disable caching on the REST API. | |
| 13 | + // if ( class_exists( 'LiteSpeed\Core' ) ) { | |
| 14 | + // $this->check_litespeed(); | |
| 15 | + // } | |
| 16 | + | |
| 17 | + // Recommended technique to disable caching on the REST API by the Litespeed team. | |
| 18 | + if ( defined( 'LSCWP_V' ) ) { | |
| 19 | + do_action( 'litespeed_control_set_nocache', 'Meow Apps API must not be cached.' ); | |
| 14 | 20 | } |
| 15 | 21 | } |
| 16 | 22 | |
| 17 | - function check_litespeed() { | |
| 23 | + public function check_litespeed() { | |
| 18 | 24 | // By default, the REST API is cached by Litespeed. Why is that? |
| 19 | 25 | // It is absolutely not a good idea, especially on the admin side. |
| 20 | 26 | $cache_rest = get_option( 'litespeed.conf.cache-rest' ); |
| 21 | 27 | if ( $cache_rest ) { |
| @@ -24,6 +30,4 @@ | ||
| 24 | 30 | } |
| 25 | 31 | |
| 26 | 32 | } |
| 27 | 33 | } |
| 28 | - | |
| 29 | -?> | |