On our web hosting accounts, Agency services, and Managed Servers you have access to object cache via both Redis and Memcached.
This guide details how you connect to the different object cache systems, and how you manage settings for both. This includes how you purge the cache, and settings for how much memory Redis and/or Memcached should have access to.
Settings
On our services, both Redis and Memcached are run via socket (not on a port). To access them from your website/platform, use the following details:
Memcached
Host: /tmp/memcached
eller unix:///tmp/memcached
Port: 0
Redis
Host: /tmp/redis
eller unix:///tmp/redis
Port: 0
How you set up a connection to Redis or Memcached varies depending on what platform you use.
Manage object cache via cPanel
To adjust settings for Redis/Memcached, follow these steps:
- Begin by logging on to cPanel.
- Find the icon
Object Cache
underAdvanced
. - Now, select if you want to adjust settings for
Redis
orMemcached
using the tabs near the top of the page. This guide will use Redis for the examples, but the Memcached part works in the same way. - Under
Redis status
you’ll see whether or not Redis is running on your account. If it says Enabled in green, it’s running. Otherwise it’ll state Disabled. You may alsoStop
orRestart
Redis with the buttons. If Redis is currently stopped, you may start it with theStart
button. - Under
Settings
, you can enable or disable Redis on your account. This is done using the dropdown menu next toConfigured status
. If you want to turn it off completely, selectdisabled
and clickStop
underRedis status
(as described above).
Next toMax memory limit
, you may choose how much RAM on your web hosting account that should be available to Redis. The default is128m
, which is succifient for most cases.
Manage object cache via SSH
Apart from managing object cache via cPanel according to the instructions above, you may also handle it by accessing your web hosting account via SSH.
To start, stop or restart Redis or Memcached, use the following command:
uapi ObjectCache update_object_cache cache_name=redis/memcached
action=start/stop/restart
Enter redis
or memcached
in the command depending on which object cache system you wish to manage. Use start
, stop
, or restart
based on your intention.