From b0e82d2cc4f97823083637215d292d8c5f94734a Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Sat, 22 Jun 2019 11:13:51 +0000 Subject: [PATCH] Cron API: Prevent caching of WP Cron requests. Add `Cache-Control` and `Expires` HTTP headers to prevent caching of requests to WP Cron on systems supporting fastcgi_finish_request(). The fastcgi_finish_request() call prevents the setting of further HTTP headers by caching plugins subsequently loaded. Props kingkero. Fixes 47396. Built from https://develop.svn.wordpress.org/trunk@45560 git-svn-id: http://core.svn.wordpress.org/trunk@45371 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-cron.php | 2 ++ wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-cron.php b/wp-cron.php index 1d848c3b35..7853e79e96 100644 --- a/wp-cron.php +++ b/wp-cron.php @@ -20,6 +20,8 @@ ignore_user_abort( true ); /* Don't make the request block till we finish, if possible. */ if ( function_exists( 'fastcgi_finish_request' ) && version_compare( phpversion(), '7.0.16', '>=' ) ) { + header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' ); + header( 'Cache-Control: no-cache, must-revalidate, max-age=0' ); fastcgi_finish_request(); } diff --git a/wp-includes/version.php b/wp-includes/version.php index c7847b398f..80456a0e0e 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3-alpha-45559'; +$wp_version = '5.3-alpha-45560'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.