Skip to content

Commit

Permalink
Merge pull request #3438 from 10up/fix/autosuggest-requests
Browse files Browse the repository at this point in the history
Use only the body to build the cache key
  • Loading branch information
felipeelia authored Apr 14, 2023
2 parents 2e02f6a + 5afa7ce commit 90359be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/classes/Feature/Autosuggest/Autosuggest.php
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ public function intercept_search_request( $response, $query = [], $args = [], $f
// But only fire this if we have object caching as otherwise this comes with a performance penalty.
// If we do not have object caching we cache only one value for 5 minutes in a transient.
if ( wp_using_ext_object_cache() ) {
$cache_key = md5( wp_json_encode( $query['url'] ) . wp_json_encode( $args ) );
$cache_key = md5( wp_json_encode( $query['url'] ) . wp_json_encode( $args['body'] ) );
$request = wp_cache_get( $cache_key, 'ep_autosuggest' );
if ( false === $request ) {
$request = wp_remote_request( $query['url'], $args );
Expand Down

0 comments on commit 90359be

Please sign in to comment.