WordPress.org

Making WordPress.org

Changeset 3098


Ignore:
Timestamp:
05/07/2016 02:01:09 PM (4 years ago)
Author:
iandunn
Message:

WordCamp JSON API: Cache v2 endpoints also.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/wcorg-json-api.php

    r2898 r3098  
    321321    global $wp_super_cache_comments;
    322322
    323     if ( defined( 'JSON_REQUEST' ) && JSON_REQUEST ) {
     323    $api_request = ( defined( 'JSON_REQUEST' ) && JSON_REQUEST ) || ( defined( 'REST_REQUEST' ) && REST_REQUEST );
     324
     325    if ( $api_request ) {
    324326        // Accept a JSON-formatted string as an end-of-file marker, so that the page will be cached
    325327        $json_object_pattern     = '^[{].*[}]$';
Note: See TracChangeset for help on using the changeset viewer.