How do I configure Redis on shared hosting?
-
How do I configure Redis on shared hosting?
Is there a way to configure Redis directly in wp-config.php?
I’m testing the plugin, thank you for creating this great plugin.
-
Thank you for trying QuantumCache!
Yes, you can configure Redis via
wp-config.php, but there are a couple of important prerequisites.- Make sure Redis is actually available
On shared hosting, Redis only works if your host provides a Redis service, and
the PHPredisextension is installed (php-redis)If that extension isn’t available, QuantumCache will automatically fall back to MySQL.
- Basic
wp-config.phpsetup
You can define your Redis connection like this:
define( ‘QUANTUMCACHE_REDIS_HOST’, ‘127.0.0.1’ );
define( ‘QUANTUMCACHE_REDIS_PORT’, 6379 );
define( ‘QUANTUMCACHE_REDIS_DB’, 0 );(Optional)
define( ‘QUANTUMCACHE_KEY_PREFIX’, ‘mysite:qc:’ );
define( ‘WP_CACHE_KEY_SALT’, ‘your-unique-salt’ );If these constants are set, they override anything configured in the plugin UI.
- Store mode (important)
QuantumCache still uses the store mode setting:
auto (default): tries Redis → falls back to MySQL
redis: forces Redis (will fail if unavailable)
mysql: disables RedisFor most shared hosting setups, leave it on auto.
- How to verify it’s working Run:
wp quantumcache status
Or check response headers (look forX-QC-Store: redis)
Short version:
- Yes,
wp-config.phpworks for Redis config - Redis must be provided by your host with
php-redisenabled - Otherwise, QuantumCache will quietly fall back to MySQL
One more question: I left the settings at default, but when I pressed the “clear all cache” button, the Entries and Tags parameters didn’t return to 0; I didn’t see any changes. Is there a problem?
I ran the command
wp quantumcache statusand got the result.Error: 'quantumcache' is not a registered wp command. See 'wp help' for available commands.Thanks for reporting this.
There was an issue in the current build where “Clear all cache” wasn’t working correctly. That’s why the Entries/Tags values didn’t change.
I’ve fixed this and it will be included in the next release (0.1.7), which I expect to publish tomorrow.
Also, the “wp quantumcache” commands are part of that same upcoming release. They aren’t in the current version.
I appreciate you taking the time to test it. I’ve updated my automated tests accordingly.
To further clarify, I made a mistake on my end earlier by suggesting you use “
wp quantumcache status“. I was referencing the 1.7 release in my development environment rather than the public release. I still plan to release it tomorrow however.Thanks again.
Thank you very much again for writing this plugin. Thanks
You are very welcome! Thank you for your patience as I work out the bugs.
I just released version 0.1.7 which should address the issues you reported. If you still have problems let me know, and I’ll do my best to get them resolved.
Everything worked well, thank you very much. I will test it on my site to see how the time will be.
You must be logged in to reply to this topic.