This plugin enables WP Rocket to store its generated cache files in the Redis database instead of the default filesystem storage.
- WP Rocket WordPress Plugin (tested up to v3.5.5.1)
- Redis Server
- PHP 7+
You may use the following constants to configure the plugin. All constants will take preference over the defined settings if there are any.
WPR_REDIS_SCHEMENeeds to be set tounixto use a unix socket to connect.WPR_REDIS_HOSTFor TCP connections this will be the IP or hostname of the server. If you are using a socket connection this will be the socket path. Default:localhostWPR_REDIS_PORTPort to connect to the server using TCP. Default6379WPR_REDIS_DBThe Database to be used. Default0WPR_REDIS_PWDRedis server password if needed.WPR_REDIS_SALTIf set all stored keys will be prefixed by this salt. To further differentiate all keys will pre prefixed by their respective database table prefix as well.
- Connection to any kind of Redis cluster is currently not supported
- If you are using nginx and if you can alter its configuration the Rocket-Nginx configuration seems to be faster than this (tested using a NVME SSD equipped server)
This plugin uses WP Rocket's namespacing to alter its file modification functions as well as WP Rockets advanced-cache.php file content filter to register itself. Any API changes from the side of WP Rocket might break this plugin's functionality so please report any issues you might have in the GitHub issue tracker.