Title: Redis cache / Docker
Last modified: August 22, 2024

---

# Redis cache / Docker

 *  Resolved [othqsa95](https://wordpress.org/support/users/othqsa95/)
 * (@othqsa95)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/redis-cache-docker/)
 * hello,
 * i’ll use the same container with multiple websites.
 * I need to insert this code in the wp-config.php
 * // adjust Redis host and port if necessary define( ‘WP_REDIS_HOST’, ‘127.0.0.1’);
   define( ‘WP_REDIS_PORT’, 6379 );
 * // change the prefix and database for each site to avoid cache data collisionsdefine(‘
   WP_REDIS_PREFIX’, ‘my-moms-site’ );
 * define( ‘WP_REDIS_DATABASE’, 0 ); // 0-15
 * // reasonable connection and read+write timeoutsdefine( ‘WP_REDIS_TIMEOUT’, 1);
 * define( ‘WP_REDIS_READ_TIMEOUT’, 1 );
 * Regarding this line:
 * define( ‘WP_REDIS_PREFIX’, ‘my-moms-site’ );
 * I just need to put the name of the website or the domainname.com ?
 * Regarding this line:
 * define( ‘WP_REDIS_DATABASE’, 0 ); // 0-15
 * For the 1st website, I put 0, the second 1 etc… ?
 * Can you confirm?
 * Thank you.

Viewing 1 replies (of 1 total)

 *  Plugin Author [Till Krüss](https://wordpress.org/support/users/tillkruess/)
 * (@tillkruess)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/redis-cache-docker/#post-18006587)
 * I’d suggest not using `WP_REDIS_PREFIX` at all, and instead use a different `
   WP_REDIS_DATABASE` for each WordPress site.
 * You could still have `WP_REDIS_PREFIX` as a backup to avoid data collision should
   two sites use the same `WP_REDIS_DATABASE` by accident.

Viewing 1 replies (of 1 total)

The topic ‘Redis cache / Docker’ is closed to new replies.

 * ![](https://ps.w.org/redis-cache/assets/icon-256x256.gif?rev=2568513)
 * [Redis Object Cache](https://wordpress.org/plugins/redis-cache/)
 * [Support Threads](https://wordpress.org/support/plugin/redis-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/redis-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/redis-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/redis-cache/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Till Krüss](https://wordpress.org/support/users/tillkruess/)
 * Last activity: [1 year, 8 months ago](https://wordpress.org/support/topic/redis-cache-docker/#post-18006587)
 * Status: resolved