diff --git a/includes/classes/REST/Sync.php b/includes/classes/REST/Sync.php index e57726faa7..41280bdddc 100644 --- a/includes/classes/REST/Sync.php +++ b/includes/classes/REST/Sync.php @@ -132,6 +132,8 @@ public function check_permission() { * @return void */ public function sync( \WP_REST_Request $request ) { + nocache_headers(); + $index_meta = Utils\get_indexing_status(); if ( isset( $index_meta['method'] ) && 'cli' === $index_meta['method'] ) { @@ -179,6 +181,8 @@ public function output( array $message ) { * @return void */ public function get_sync_status( \WP_REST_Request $request ) { + nocache_headers(); + $index_meta = Utils\get_indexing_status(); if ( isset( $index_meta['method'] ) && 'cli' === $index_meta['method'] ) { @@ -211,6 +215,8 @@ public function get_sync_status( \WP_REST_Request $request ) { * @return void */ public function cancel_sync( \WP_REST_Request $request ) { + nocache_headers(); + $index_meta = Utils\get_indexing_status(); if ( isset( $index_meta['method'] ) && 'cli' === $index_meta['method'] ) {