Make WordPress Core

Changeset 45560


Ignore:
Timestamp:
06/22/2019 11:12:58 AM (5 years ago)
Author:
peterwilsoncc
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-cron.php

    r45559 r45560  
    2121/* Don't make the request block till we finish, if possible. */
    2222if ( function_exists( 'fastcgi_finish_request' ) && version_compare( phpversion(), '7.0.16', '>=' ) ) {
     23    header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' );
     24    header( 'Cache-Control: no-cache, must-revalidate, max-age=0' );
    2325    fastcgi_finish_request();
    2426}
Note: See TracChangeset for help on using the changeset viewer.