{"id":15426,"date":"2021-10-13T11:57:20","date_gmt":"2021-10-13T10:57:20","guid":{"rendered":"https:\/\/www.oderland.se\/support\/artikel\/hur-anvander-jag-object-cache-funktionen-pa-cpanel\/"},"modified":"2023-05-15T09:14:00","modified_gmt":"2023-05-15T08:14:00","slug":"how-do-i-use-the-object-cache-feature-via-cpanel","status":"publish","type":"ht_kb","link":"https:\/\/www.oderland.se\/support\/en\/artikel\/how-do-i-use-the-object-cache-feature-via-cpanel\/","title":{"rendered":"How do I use the Object Cache feature via cPanel?"},"content":{"rendered":"\n<p>On our <a href=\"https:\/\/www.oderland.com\/web-hosting\/\" target=\"_blank\" rel=\"noreferrer noopener\">web hosting accounts<\/a>, <a href=\"https:\/\/www.oderland.com\/solutions\/agency\/\" target=\"_blank\" rel=\"noreferrer noopener\">Agency<\/a> services, and <a href=\"https:\/\/www.oderland.com\/servers\/\" target=\"_blank\" rel=\"noreferrer noopener\">Managed Servers<\/a> you have access to object cache via both <a href=\"https:\/\/redis.io\/\" target=\"_blank\" rel=\"noreferrer noopener\">Redis<\/a> and <a href=\"https:\/\/www.memcached.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">Memcached<\/a>.<\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-danger\"><strong>Activate the PHP extensions for object cache<\/strong><br>Keep in mind that you need to activate the appropriate PHP extensions for Redis and\/or Memcached before you try to use them. <a rel=\"noreferrer noopener\" href=\"https:\/\/www.oderland.se\/support\/en\/artikel\/how-do-i-manage-php\/#how-do-i-managed-php-extensions\" target=\"_blank\">These instructions<\/a> show you how to activate the extensions.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Settings<\/h2>\n\n\n\n<p>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:<\/p>\n\n\n\n<p class=\"has-medium-font-size\">Memcached<\/p>\n\n\n\n<p><strong>Host<\/strong>:  <code>\/tmp\/memcached<\/code> eller <code>unix:\/\/\/tmp\/memcached<\/code><br><strong>Port<\/strong>: <code>0<\/code><\/p>\n\n\n\n<p class=\"has-medium-font-size\">Redis <\/p>\n\n\n\n<p><strong>Host<\/strong>: <code>\/tmp\/redis<\/code> eller <code>unix:\/\/\/tmp\/redis<\/code><br><strong>Port<\/strong>: <code>0<\/code><\/p>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-info\">You don&#8217;t need to enter any username and\/or password for neither Memcached nor Redis.<\/p>\n\n\n\n<p>How you set up a connection to Redis or Memcached varies depending on what platform you use.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Manage object cache via cPanel<\/h2>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-info\">If your web hosting account is located on one of our older shared hosting servers, you will not find the icon Object Cache through cPanel according to the instructions below. You may however still use Redis and\/or Memcached according to the details <a href=\"#settings\">above<\/a>, but the icon itself will not be available.<\/p>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-alert\">The instructions below will use Redis as an example, but all settings work in the same manner for Memcached.<\/p>\n\n\n\n<p>To adjust settings for Redis\/Memcached, follow these steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Begin by <a rel=\"noreferrer noopener\" href=\"https:\/\/www.oderland.se\/support\/en\/artikel\/how-do-i-login-to-cpanel\/\" data-type=\"ht_kb\" data-id=\"4236\" target=\"_blank\">logging on to cPanel<\/a>.<\/li>\n\n\n\n<li>Find the icon <code>Object Cache<\/code> under <code>Advanced<\/code>.<br><a href=\"https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2021\/10\/cpanel_icon_object_cache-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"697\" height=\"312\" class=\"wp-image-18597\" style=\"width: 697px;\" src=\"https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2021\/10\/cpanel_icon_object_cache-1.png\" alt=\"\" srcset=\"https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2021\/10\/cpanel_icon_object_cache-1.png 697w, https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2021\/10\/cpanel_icon_object_cache-1-300x134.png 300w, https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2021\/10\/cpanel_icon_object_cache-1-50x22.png 50w, https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2021\/10\/cpanel_icon_object_cache-1-60x27.png 60w, https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2021\/10\/cpanel_icon_object_cache-1-100x45.png 100w\" sizes=\"auto, (max-width: 697px) 100vw, 697px\" \/><\/a><\/li>\n\n\n\n<li>Now, select if you want to adjust settings for <code>Redis<\/code> or <code>Memcached<\/code> 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.<br><a href=\"https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2021\/10\/cpanel_object_cache_redis_memcached.png\"><img loading=\"lazy\" decoding=\"async\" width=\"267\" height=\"116\" class=\"wp-image-18595\" style=\"width: 267px;\" src=\"https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2021\/10\/cpanel_object_cache_redis_memcached.png\" alt=\"\" srcset=\"https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2021\/10\/cpanel_object_cache_redis_memcached.png 267w, https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2021\/10\/cpanel_object_cache_redis_memcached-50x22.png 50w, https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2021\/10\/cpanel_object_cache_redis_memcached-60x26.png 60w, https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2021\/10\/cpanel_object_cache_redis_memcached-100x43.png 100w\" sizes=\"auto, (max-width: 267px) 100vw, 267px\" \/><\/a><\/li>\n\n\n\n<li>Under <code>Redis status<\/code> you&#8217;ll see whether or not Redis is running on your account. If it says <strong>Enabled<\/strong> in green, it&#8217;s running. Otherwise it&#8217;ll state <strong>Disabled<\/strong>. You may also <code>Stop<\/code> or <code>Restart<\/code> Redis with the buttons. If Redis is currently stopped, you may start it with the <code>Start<\/code> button.<br><a href=\"https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2021\/10\/cpanel_object_cache_status.png\"><img loading=\"lazy\" decoding=\"async\" width=\"403\" height=\"102\" class=\"wp-image-15441\" style=\"width: 403px;\" src=\"https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2021\/10\/cpanel_object_cache_status.png\" alt=\"\"><\/a><\/li>\n\n\n\n<li>Under <code>Settings<\/code>, you can enable or disable Redis on your account. This is done using the dropdown menu next to <code>Configured status<\/code>. If you want to turn it off completely, select <code>disabled<\/code> and click <code>Stop<\/code> under <code>Redis status<\/code> (as described above).<br>Next to <code>Max memory limit<\/code>, you may choose how much RAM on your web hosting account that should be available to Redis. The default is <code>128m<\/code>, which is succifient for most cases.<br><a href=\"https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2021\/10\/cpanel_object_cache_settings-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"459\" height=\"139\" class=\"wp-image-15702\" style=\"width: 459px;\" src=\"https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2021\/10\/cpanel_object_cache_settings-1.png\" alt=\"\"><\/a><\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-info\">Please note that Redis will be restarted of you change the Max memory limit. Upon restart all cache stored within Redis will be purged.<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"6\">\n<li>Under <code>Information<\/code> you can see various data regarding Redis.<br><a href=\"https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2021\/10\/cpanel_object_cache_information-2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"466\" height=\"123\" class=\"wp-image-15449\" style=\"width: 466px;\" src=\"https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2021\/10\/cpanel_object_cache_information-2.png\" alt=\"\"><\/a><\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Manage object cache via SSH<\/h2>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-danger\">This part of the guide is intended for advanced users. The user is assumed to have a working knowledge about how to use SSH.<\/p>\n\n\n\n<p>Apart from managing object cache via cPanel according to the instructions <a href=\"#manage-object-cache-via-cpanel\">above<\/a>, you may also handle it by accessing your web hosting account via <a href=\"https:\/\/www.oderland.se\/support\/en\/artikel\/how-do-i-connect-to-my-web-hosting-account-using-ssh\/\" data-type=\"ht_kb\" data-id=\"4832\" target=\"_blank\" rel=\"noreferrer noopener\">SSH<\/a>.<\/p>\n\n\n\n<p>To start, stop or restart Redis or Memcached, use the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">uapi ObjectCache update_object_cache cache_name=<code>redis\/memcached<\/code> action=<code>start\/stop\/restart<\/code><\/pre>\n\n\n\n<p>Enter <code>redis<\/code> or <code>memcached<\/code> in the command depending on which object cache system you wish to manage. Use <code>start<\/code>, <code>stop<\/code>, or <code>restart<\/code> based on your intention.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8230;<\/p>\n","protected":false},"author":12,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"ht-kb-category":[213],"ht-kb-tag":[],"class_list":["post-15426","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-developer-tools"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb\/15426","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/comments?post=15426"}],"version-history":[{"count":28,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb\/15426\/revisions"}],"predecessor-version":[{"id":18600,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb\/15426\/revisions\/18600"}],"wp:attachment":[{"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/media?parent=15426"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb-category?post=15426"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb-tag?post=15426"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}