Skip to content

Instantly share code, notes, and snippets.

@chasecmiller
Created January 11, 2018 18:20
Show Gist options
  • Save chasecmiller/21fb0863e3da17358542dda6c90421bb to your computer and use it in GitHub Desktop.
Save chasecmiller/21fb0863e3da17358542dda6c90421bb to your computer and use it in GitHub Desktop.
WPEngine - Cache key override - You need this if you want to run a secondary ( or multisite ) in a subdirectory on WP Engine
<?php
/**
* Author: Chase C. Miller
* Working Date: 2017-01-11
* Custom cache key for WPEngine to bypass object caching problems that can happen when you install a secondary or multisite on WPEngine.
* It should be installed as a mu-plugin to catch early activation.
**/
global $wp_object_cache;
if ($wp_object_cache && get_class($wp_object_cache) == 'WP_Object_Cache') {
// Change a-unique-key to a unique identifier for your site.
$wp_object_cache->customer = 'a-unique-key';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment