diff --git a/ocp-install.sh b/ocp-install.sh index 8d65e72..9c93e20 100644 --- a/ocp-install.sh +++ b/ocp-install.sh @@ -2,10 +2,56 @@ cd /var/www/webroot/ROOT -#disable litespeed object cache (not entire plugin) +# check if litespeed cache is enabled + +litespeed_enabled=$(wp plugin is-active litespeed-cache) + +# disable object caching if so +if [ -n "$result" ]; then + wp litespeed-option set object 0 +fi -#wp plugin install redis-cache --activate #install OCP instead +wp plugin install 'https://objectcache.pro/plugin/object-cache-pro.zip?token=091801712a649241ca11668fdf19552c2d13dad4d9b1d28848c276cd5111' --force --activate + + + +# config OCP + +define('WP_REDIS_CONFIG', [ + 'token' => '091801712a649241ca11668fdf19552c2d13dad4d9b1d28848c276cd5111', + 'host' => '/var/run/redis/redis.sock', + 'port' => 0, + 'client' => 'relay', + 'database' => 0, + 'prefix' => 'db0', + + // whether multiple WordPress sites use the Redis instance + 'shared' => true, + + // reduce memory usage + 'compression' => 'zstd', + 'serializer' => 'igbinary', + + // experiment with these, some sites may benefits, so may not + 'prefetch' => false, + 'split_alloptions' => false, + + // standard options + 'timeout' => 0.5, + 'read_timeout' => 0.5, + 'retries' => 3, + 'backoff' => 'smart', + + // debug only + 'debug' => false, + 'save_commands' => false, +]); + +define('WP_REDIS_DISABLED', false); + + + wp config set WP_REDIS_IGNORED_GROUPS "['comment','counts','plugins','themes','wc_session_id','learndash_reports','learndash_admin_profile','bp_messages','bp_messages_threads']" --raw wp config set WP_REDIS_CLIENT 'relay'