problem configuring redis
-
Hi,
I’m trying to configure W3TC with Redis and I’m experiencing multiple configuration issues.
Let me explain my situation and setup first so that the rest will be more clear
On the localhost I have set up
– a redis-server which is listening on 127.0.0.1:6379 with empty password
– a docker instance redis-server which is listening on 127.0.0.1:63790 with a passwordI’m running monitor db command in both redis instances to see where W3TC is writing at.
And I would like to setup W3TC to use the docker instance only.
I’ve read about the db-config.php file but in my case adding that to
wp-content\plugins\w3-total-cache\ini\
does not work.
It doesn’t seem to load the file at all. I’ve tried naming it db-config.php and config-db.php after I found the file wp-content\plugins\w3-total-cache\ini\config-db-sample.php
None of the above worked. This is the first issue.
In the end I’ve copied the config from file
wp-content\plugins\w3-total-cache\ini\config-db-sample.php to wp-config.php to make sure the variables are defined even before W3TC is initiated and that seems to have an effect. So I added the following
define( 'W3TC_CONFIG_CACHE_ENGINE', 'redis'); define( 'W3TC_CONFIG_CACHE_REDIS_SERVERS', 'redis_hostname::63790' ); // optional redis settings define( 'W3TC_CONFIG_CACHE_REDIS_PERSISTENT', true ); define( 'W3TC_CONFIG_CACHE_REDIS_DBID', 0 ); define( 'W3TC_CONFIG_CACHE_REDIS_PASSWORD', 'mypass' );
Now I’m monitoring my redis-servers and W3TC is writing to both redis-servers the data.
I’ve shut down the redis-server on localhost and it’s only writing to the docker instance. I’ve shut down the docker instance and it’s only writing to the local instance.
So, how do I force it to write only to the defined instance via config properly? This is my second issue
Finally it’s always writing to database 0, never to 15 that I added to the config in both instances local and docker.
- The topic ‘problem configuring redis’ is closed to new replies.