Make WordPress Core

Changeset 53653


Ignore:
Timestamp:
07/05/2022 03:12:36 AM (2 years ago)
Author:
peterwilsoncc
Message:

Cron API: Make wp-cron non-blocking for LiteSpeed LSAPI.

This should make cron spawning faster on LSAPI by ensuring that cron requests return immediately.

To avoid code repetition, the no caching headers are relocated and always sent. Caching plugins attempting to set these
headers later will replace those set by WordPress Core.

Follow up to [44488].

Props maximej, johnbillion.
Fixes #54668.

File:
1 edited

Legend:

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

    r53426 r53653  
    1919ignore_user_abort( true );
    2020
     21if ( ! headers_sent() ) {
     22    header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' );
     23    header( 'Cache-Control: no-cache, must-revalidate, max-age=0' );
     24}
     25
    2126/* Don't make the request block till we finish, if possible. */
    2227if ( PHP_VERSION_ID >= 70016 && function_exists( 'fastcgi_finish_request' ) ) {
    23     if ( ! headers_sent() ) {
    24         header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' );
    25         header( 'Cache-Control: no-cache, must-revalidate, max-age=0' );
    26     }
    27 
    2828    fastcgi_finish_request();
     29} elseif ( function_exists( 'litespeed_finish_request' ) ) {
     30    litespeed_finish_request();
    2931}
    3032
Note: See TracChangeset for help on using the changeset viewer.