WordPress.org

Make WordPress Core

Ticket #25072: wp-cron.php.diff

File wp-cron.php.diff, 788 bytes (added by westonruter, 8 years ago)

Patch to wp-cron.php to do nocache_headers()

  • wp-cron.php

     
    2626        require_once('./wp-load.php');
    2727}
    2828
     29// If using DISABLE_WP_CRON and are using curl with system cron to ping wp-cron.php,
     30// make sure that any intermediary proxies do not cache the request or else the
     31// scheduled tasks will not happen until the cache gets stale.
     32function _add_surrogate_control_to_nocache_headers( $headers ) {
     33        $headers['Surrogate-Control'] = 'no-store';
     34        return $headers;
     35}
     36add_filter( 'nocache_headers', '_add_surrogate_control_to_nocache_headers' );
     37nocache_headers();
     38
    2939// Uncached doing_cron transient fetch
    3040function _get_cron_lock() {
    3141        global $_wp_using_ext_object_cache, $wpdb;