When running more than one WordPress installation on the same Redis instance or cluster, it’s highly recommended to use a separate Redis database for each site.
If several sites must share the same database, a unique
prefix can be configured for each site.
Using Databases #
For the best performance, it’s recommended to use a different database index
0-15 for each WordPress installation, by using the
database configuration option.
By default, Redis has 16 databases. This can be increased to in your
'host' => '127.0.0.1',
'database' => 0,
Keep in mind that Redis clusters only have a single database.
Using Prefixes #
When only a single database is available to you, best way to isolate individual sites is using the
prefix configuration option.
The downside of using a prefix over different databases is that cache flushes are global. If site A flushes the object cache, then site B and C will also be flushed.
'prefix' => 'mysitename',
Prefixes must be 14 characters or less. To optimize human readability avoid special characters and use simple string such as: