Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use only the body to build the cache key #3438

Merged
merged 1 commit into from
Apr 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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