Changeset 2949524
- Timestamp:
- 08/08/2023 06:00:19 PM (3 years ago)
- Location:
- pantheon-advanced-page-cache
- Files:
-
- 6 edited
- 1 copied
-
tags/1.4.1 (copied) (copied from pantheon-advanced-page-cache/trunk)
-
tags/1.4.1/inc/class-emitter.php (modified) (1 diff)
-
tags/1.4.1/pantheon-advanced-page-cache.php (modified) (2 diffs)
-
tags/1.4.1/readme.txt (modified) (3 diffs)
-
trunk/inc/class-emitter.php (modified) (1 diff)
-
trunk/pantheon-advanced-page-cache.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pantheon-advanced-page-cache/tags/1.4.1/inc/class-emitter.php
r2946260 r2949524 133 133 public static function filter_rest_post_dispatch( $result, $server ) { 134 134 $keys = self::get_rest_api_surrogate_keys(); 135 if ( ! empty( $keys ) ) {136 $ server->send_header( self::HEADER_KEY, implode( ' ', $keys ) );135 if ( ! empty( $keys ) && $result instanceof \WP_REST_Response ) { 136 $result->header( self::HEADER_KEY, implode( ' ', $keys ) ); 137 137 } 138 138 return $result; -
pantheon-advanced-page-cache/tags/1.4.1/pantheon-advanced-page-cache.php
r2946260 r2949524 8 8 * Text Domain: pantheon-advanced-page-cache 9 9 * Domain Path: /languages 10 * Version: 1.4. 010 * Version: 1.4.1 11 11 * 12 12 * @package Pantheon_Advanced_Page_Cache … … 80 80 /** 81 81 * Prefix surrogate keys with the blog ID to provide compatibility with WPMS. See https://github.com/pantheon-systems/pantheon-advanced-page-cache/issues/196. 82 * 82 * 83 83 * @param array $keys Keys to be prefixed. 84 84 */ -
pantheon-advanced-page-cache/tags/1.4.1/readme.txt
r2946260 r2949524 1 1 === Pantheon Advanced Page Cache === 2 Contributors: getpantheon, danielbachhuber, kporras07, jspellman, jazzs3quence, ryanshoover, rwagner00 2 Contributors: getpantheon, danielbachhuber, kporras07, jspellman, jazzs3quence, ryanshoover, rwagner00, pwtyler 3 3 Tags: pantheon, cdn, cache 4 4 Requires at least: 4.7 5 Tested up to: 6. 26 Stable tag: 1.4. 05 Tested up to: 6.3 6 Stable tag: 1.4.1 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 295 295 Setting surrogate keys for posts with large numbers of taxonomies (such as WooCommerce products with a large number of global attributes) can suffer from slower queries. Surrogate keys can be skipped for 'product' post types' taxonomy terms (or any other criteria you see fit) with the following filter: 296 296 297 ``` 298 function custom_should_add_terms($should_add_terms, $wp_query) { 299 if ( $wp_query->is_singular( 'product' ) ) { 300 return false; 301 } 302 return $should_add_terms; 303 } 304 add_filter('pantheon_should_add_terms', 'custom_should_add_terms', 10, 2); 305 ``` 297 function custom_should_add_terms($should_add_terms, $wp_query) { 298 if ( $wp_query->is_singular( 'product' ) ) { 299 return false; 300 } 301 return $should_add_terms; 302 } 303 add_filter('pantheon_should_add_terms', 'custom_should_add_terms', 10, 2); 306 304 307 305 == Plugin Integrations == … … 316 314 317 315 == Changelog == 316 317 = 1.4.1 = 318 * Send the REST API response header to the result and not the REST server [[#237](https://github.com/pantheon-systems/pantheon-advanced-page-cache/pull/237)]. Props [@srtfisher](https://github.com/srtfisher) & [@felixarntz](https://github.com/felixarntz). 318 319 319 320 = 1.4.0 = -
pantheon-advanced-page-cache/trunk/inc/class-emitter.php
r2946260 r2949524 133 133 public static function filter_rest_post_dispatch( $result, $server ) { 134 134 $keys = self::get_rest_api_surrogate_keys(); 135 if ( ! empty( $keys ) ) {136 $ server->send_header( self::HEADER_KEY, implode( ' ', $keys ) );135 if ( ! empty( $keys ) && $result instanceof \WP_REST_Response ) { 136 $result->header( self::HEADER_KEY, implode( ' ', $keys ) ); 137 137 } 138 138 return $result; -
pantheon-advanced-page-cache/trunk/pantheon-advanced-page-cache.php
r2946260 r2949524 8 8 * Text Domain: pantheon-advanced-page-cache 9 9 * Domain Path: /languages 10 * Version: 1.4. 010 * Version: 1.4.1 11 11 * 12 12 * @package Pantheon_Advanced_Page_Cache … … 80 80 /** 81 81 * Prefix surrogate keys with the blog ID to provide compatibility with WPMS. See https://github.com/pantheon-systems/pantheon-advanced-page-cache/issues/196. 82 * 82 * 83 83 * @param array $keys Keys to be prefixed. 84 84 */ -
pantheon-advanced-page-cache/trunk/readme.txt
r2946260 r2949524 1 1 === Pantheon Advanced Page Cache === 2 Contributors: getpantheon, danielbachhuber, kporras07, jspellman, jazzs3quence, ryanshoover, rwagner00 2 Contributors: getpantheon, danielbachhuber, kporras07, jspellman, jazzs3quence, ryanshoover, rwagner00, pwtyler 3 3 Tags: pantheon, cdn, cache 4 4 Requires at least: 4.7 5 Tested up to: 6. 26 Stable tag: 1.4. 05 Tested up to: 6.3 6 Stable tag: 1.4.1 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 295 295 Setting surrogate keys for posts with large numbers of taxonomies (such as WooCommerce products with a large number of global attributes) can suffer from slower queries. Surrogate keys can be skipped for 'product' post types' taxonomy terms (or any other criteria you see fit) with the following filter: 296 296 297 ``` 298 function custom_should_add_terms($should_add_terms, $wp_query) { 299 if ( $wp_query->is_singular( 'product' ) ) { 300 return false; 301 } 302 return $should_add_terms; 303 } 304 add_filter('pantheon_should_add_terms', 'custom_should_add_terms', 10, 2); 305 ``` 297 function custom_should_add_terms($should_add_terms, $wp_query) { 298 if ( $wp_query->is_singular( 'product' ) ) { 299 return false; 300 } 301 return $should_add_terms; 302 } 303 add_filter('pantheon_should_add_terms', 'custom_should_add_terms', 10, 2); 306 304 307 305 == Plugin Integrations == … … 316 314 317 315 == Changelog == 316 317 = 1.4.1 = 318 * Send the REST API response header to the result and not the REST server [[#237](https://github.com/pantheon-systems/pantheon-advanced-page-cache/pull/237)]. Props [@srtfisher](https://github.com/srtfisher) & [@felixarntz](https://github.com/felixarntz). 318 319 319 320 = 1.4.0 =
Note: See TracChangeset
for help on using the changeset viewer.