wp-config settings to avoid other sites using same data
-
I am new to redis and recently just enabled the plugin on my hosting to find that two sites were using the same redis database number so they were overwriting each other. I did not know this as I am new and I need to avoid this. I need to avoid collisions if the site is cloned to staging and then back to live and hard coding config will be a problem. this seems to be a problem so there muse be a solution or possibly my hosting is the limitation. ideally this isolation would be at the server level but I do not know and looking for any advice or direction.
if I added the below config code to my wp-config files will this work to isolate or will I have issues?define(‘WP_REDIS_DATABASE’, 0);
define(
‘WP_REDIS_PREFIX’,
preg_replace(‘/[^a-z0-9]/i’, ‘-‘, strtolower($_SERVER[‘HTTP_HOST’])) . ‘:’
);define(
‘WP_CACHE_KEY_SALT’,
strtolower($_SERVER[‘HTTP_HOST’])
);
You must be logged in to reply to this topic.