Skip to content

Commit

Permalink
Send no-cache headers to sync related API calls
Browse files Browse the repository at this point in the history
  • Loading branch information
felipeelia committed Oct 29, 2023
1 parent e64c22a commit 7e9c5f2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions includes/classes/REST/Sync.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'] ) {
Expand Down Expand Up @@ -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'] ) {
Expand Down Expand Up @@ -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'] ) {
Expand Down

0 comments on commit 7e9c5f2

Please sign in to comment.