Initial version of script for manual testing
parent
3568567e9b
commit
901ed91e72
|
@ -7,27 +7,39 @@ cd /var/www/webroot/ROOT
|
||||||
litespeed_enabled=$(wp plugin is-active litespeed-cache)
|
litespeed_enabled=$(wp plugin is-active litespeed-cache)
|
||||||
|
|
||||||
# disable object caching if so
|
# disable object caching if so
|
||||||
if [ -n "$result" ]; then
|
if [ -n "$litespeed_enabled" ]; then
|
||||||
wp litespeed-option set object 0
|
wp litespeed-option set object 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#install OCP instead
|
#install OCP instead
|
||||||
wp plugin install 'https://objectcache.pro/plugin/object-cache-pro.zip?token=091801712a649241ca11668fdf19552c2d13dad4d9b1d28848c276cd5111' --force --activate
|
wp plugin install 'https://objectcache.pro/plugin/object-cache-pro.zip?token=091801712a649241ca11668fdf19552c2d13dad4d9b1d28848c276cd5111' --force --activate
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# config OCP
|
# config OCP
|
||||||
|
|
||||||
define('WP_REDIS_CONFIG', [
|
# TODO check if is a cluster and get port,
|
||||||
|
|
||||||
|
is_cluster=false
|
||||||
|
|
||||||
|
if $is_cluster; then
|
||||||
|
host=IP.ADD.HERE
|
||||||
|
port=6379
|
||||||
|
password="password from end of redis node conf file"
|
||||||
|
else
|
||||||
|
# use default single-node configuration
|
||||||
|
host=/var/run/redis/redis.sock
|
||||||
|
port=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
ocp_config="[
|
||||||
'token' => '091801712a649241ca11668fdf19552c2d13dad4d9b1d28848c276cd5111',
|
'token' => '091801712a649241ca11668fdf19552c2d13dad4d9b1d28848c276cd5111',
|
||||||
'host' => '/var/run/redis/redis.sock',
|
'host' => '$host',
|
||||||
'port' => 0,
|
'port' => $port,
|
||||||
'client' => 'relay',
|
'client' => 'relay',
|
||||||
'database' => 0,
|
'database' => 0,
|
||||||
'prefix' => 'db0',
|
'prefix' => 'db0',
|
||||||
|
|
||||||
// whether multiple WordPress sites use the Redis instance
|
// whether multiple WordPress sites use the Redis instance
|
||||||
'shared' => true,
|
'shared' => false,
|
||||||
|
|
||||||
// reduce memory usage
|
// reduce memory usage
|
||||||
'compression' => 'zstd',
|
'compression' => 'zstd',
|
||||||
|
@ -46,19 +58,18 @@ define('WP_REDIS_CONFIG', [
|
||||||
// debug only
|
// debug only
|
||||||
'debug' => false,
|
'debug' => false,
|
||||||
'save_commands' => false,
|
'save_commands' => false,
|
||||||
]);
|
]"
|
||||||
|
|
||||||
define('WP_REDIS_DISABLED', false);
|
wp config set WP_REDIS_CONFIG $ocp_config --raw
|
||||||
|
wp config set WP_REDIS_DISABLED false --raw
|
||||||
|
|
||||||
|
# free redis object cache config
|
||||||
|
#wp config set WP_REDIS_CLIENT 'relay'
|
||||||
|
#wp config set WP_REDIS_SCHEME 'unix'
|
||||||
|
#wp config set WP_REDIS_IGBINARY true --raw
|
||||||
|
#wp config set WP_REDIS_PATH '/var/run/redis/redis.sock'
|
||||||
|
#wp config set WP_REDIS_PORT 0 --raw
|
||||||
|
#wp config set WP_REDIS_DATABASE 0 --raw
|
||||||
|
#wp redis enable
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
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'
|
|
||||||
wp config set WP_REDIS_SCHEME 'unix'
|
|
||||||
wp config set WP_REDIS_IGBINARY true --raw
|
|
||||||
wp config set WP_REDIS_PATH '/var/run/redis/redis.sock'
|
|
||||||
wp config set WP_REDIS_PORT 0 --raw
|
|
||||||
wp config set WP_REDIS_DATABASE 0 --raw
|
|
||||||
wp redis enable
|
|
||||||
wp cache flush
|
wp cache flush
|
Loading…
Reference in New Issue