Data encoding
Using Object Cache Pro’s serializer
and compression
configuration options reduces Redis memory usage by up to ~76%. While that’s fantastic, enabling or changing serialization and compression requires some extra steps.
Every time the serializer
or compression
configuration option is changed, you must flush your entire Redis database to avoid corrupt data and crashing your site.
Staging procedure #
Since development and staging environments are more forgiving of downtime just go ahead and:
- Change
serializer
/compression
option - Run
redis-cli flushdb
Production procedure #
In production environments that cannot afford downtime it’s recommended to:
- Disable the object cache:
wp redis disable
- Run
wp redis cli
and thenflushdb
- Change
serializer
/compression
option - Re-enable the object cache:
wp redis enable