Skip to content

Instantly share code, notes, and snippets.

@tillkruss
Last active November 18, 2021 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tillkruss/c761c570193a704e389f77b47ffe0273 to your computer and use it in GitHub Desktop.
Save tillkruss/c761c570193a704e389f77b47ffe0273 to your computer and use it in GitHub Desktop.
cd ./wordpress
wget https://objectcache.pro/plugin/redis-cache-pro.zip?token=0000000000 | unzip
cp redis-cache-pro/stubs/mu-plugin.php wp-content/mu-plugins/redis-cache-pro.php
mv redis-cache-pro wp-content/mu-plugins
rm redis-cache-pro.zip
read -r -d '' WP_REDIS_CONFIG <<- EOM
[
'token' => getenv('OBJECTCACHEPRO_TOKEN'),
'host' => getenv('WP_REDIS_HOST'),
'port' => 6379,
'database' => 0, // change for each site
'timeout' => 2.5,
'read_timeout' => 2.5,
'split_alloptions' => true,
'async_flush' => true,
'client' => 'relay', // STRESS TEST
'compression' => 'zstd', // STRESS TEST
'serializer' => 'igbinary', // STRESS TEST
'prefetch' => true, // STRESS TEST
'debug' => false,
'save_commands' => false,
]
EOM
wp config set --add --raw WP_REDIS_CONFIG "${WP_REDIS_CONFIG}"
wp config set --add --raw WP_REDIS_DISABLED 'getenv('WP_REDIS_DISABLED') ?: false'
wp redis enable --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment