Skip to content

Commit

Permalink
Merge branch 'main' into cdpt-2259-prevent-elasticsearch-404-logs
Browse files Browse the repository at this point in the history
  • Loading branch information
EarthlingDavey authored Nov 11, 2024
2 parents 4ae0cb3 + 5f7bb57 commit 617b53a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions public/app/object-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@
// Conditionally, run the script if the correct class exists, and the script has not been disabled.
if ( !$is_auth_uri && class_exists( WP_REDIS_USE_RELAY ? 'Relay\Relay' : 'Redis' ) && ( ! defined( 'WP_REDIS_DISABLED' ) || ! WP_REDIS_DISABLED ) ):

// ^ When using Relay, we need to prefix a scheme to `$_SERVER['CACHE_HOST']`
if ( WP_REDIS_USE_RELAY && !empty($_SERVER['CACHE_HOST']) ) {
// Prefix scheme to the host, default to tls.
$_SERVER['CACHE_HOST'] = ($_SERVER['CACHE_SCHEME'] ?? 'tls') . '://' . $_SERVER['CACHE_HOST'];
// ^ Set the default cache scheme to `tls`, an empty string is allowed.
// If $cache_scheme is an empty string, then we don't need to prefix it.
$cache_scheme = $_SERVER['CACHE_SCHEME'] ?? 'tls';
if ( $cache_scheme !== '' && isset($_SERVER['CACHE_HOST']) ) {
// Prefix a scheme to `$_SERVER['CACHE_HOST']`
$_SERVER['CACHE_HOST'] = $cache_scheme . '://' . $_SERVER['CACHE_HOST'];
}

if ( ! defined( 'WP_CACHE_KEY_SALT' ) ) {
Expand Down

0 comments on commit 617b53a

Please sign in to comment.