{"id":36064,"date":"2022-03-29T15:00:05","date_gmt":"2022-03-29T13:00:05","guid":{"rendered":"https:\/\/qodeinteractive.com\/magazine\/?p=36064"},"modified":"2022-03-24T14:43:30","modified_gmt":"2022-03-24T13:43:30","slug":"what-is-wordpress-memcached","status":"publish","type":"post","link":"https:\/\/qodeinteractive.com\/magazine\/what-is-wordpress-memcached\/","title":{"rendered":"What is WordPress Memcached and How to Use It"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><p>[vc_row][vc_column][vc_column_text]When you have a website, its performance is one of those things that will keep you up at night. It can be perfectly fine, with all of the metrics and indicators in very respectable ranges of values, but you can still fret over it. Thanks to the many moving parts that influence how your website performs, there\u2019s always something you might have overlooked, something you can tweak, something where the smallest of changes can produce tangible impact.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Caching certainly doesn\u2019t belong to the small, easily overlooked techniques for boosting site performance. It\u2019s a bona fides method for <a href=\"https:\/\/qodeinteractive.com\/magazine\/how-to-improve-mobile-page-load-speed-in-wordpress\/\">speeding up websites<\/a>, and there are more than a few <a href=\"https:\/\/qodeinteractive.com\/magazine\/best-wordpress-caching-plugins\/\">caching plugins for WordPress<\/a> you can use. Within caching as a whole, however, Memcached tends to be overlooked. If you\u2019ve been guilty of doing it but want to stop \u2013 you\u2019re in the right place![\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]In this article, we\u2019ll show you:<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;22px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#a-primary-on-caching\">A Primary on Caching<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;5px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#what-is-memcached\">What is Memcached?<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;5px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#how-to-use-memcached-with-your-wordpress-website\">How to Use Memcached with Your WordPress Website<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;80px&#8221;][vc_widget_sidebar sidebar_id=&#8221;new-top-picks-banner&#8221;][vc_empty_space height=&#8221;80px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\"><a id=\"a-primary-on-caching\"><\/a>A Word or Two About Caching<\/h2>\n<p>[\/vc_column_text][vc_empty_space height=&#8221;21px&#8221;]<div class=\"qodef-single-image-holder    \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"553\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2022\/03\/A-Word-or-Two-About-Caching.jpg\" class=\"attachment-full size-full\" alt=\"A Word or Two About Caching\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2022\/03\/A-Word-or-Two-About-Caching.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2022\/03\/A-Word-or-Two-About-Caching-300x171.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2022\/03\/A-Word-or-Two-About-Caching-768x438.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2022\/03\/A-Word-or-Two-About-Caching-620x354.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]You probably know that people don\u2019t like spending too much time waiting for a website to load. With every second of loading time, the likelihood that they\u2019ll move away to another website grows. <strong>That\u2019s why every second counts when it comes to keeping people interested in your website.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]To lower the number of seconds people inevitably have to wait for a website to load, webmasters and admins employ something that\u2019s called caching. <strong>Caching is nothing more than storing certain things in memory so that they can be quickly and easily retrieved, speeding up things such as loading a website.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]There are many different sorts of caching. A <a href=\"https:\/\/qodeinteractive.com\/magazine\/what-is-a-cdn\/\">content delivery network \u2013 CDN<\/a> \u2013 will cache some of the contents from your page on their servers so that they load quickly when someone opens the page. Your web browser has its cache which stores HTML files and JavaScript to help websites load faster. There\u2019s also server-side caching with software like NGINX that performs it.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]And then there\u2019s object caching \u2013 a type of caching people might overlook easily. <strong>While browsers and page caching tend to cache the heavier and unwieldier elements such as images, HTML, and other kinds of files, object caching is set on caching query results.<\/strong> That way, it can speed up the workings of your database, as they won\u2019t have to generate results for every query \u2013 they\u2019ll just retrieve them from the cache. WordPress has provided a kind of support for object caching for a long while.[\/vc_column_text][vc_empty_space height=&#8221;68px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\"><a id=\"what-is-memcached\"><\/a>What is Memcached?<\/h2>\n<p>[\/vc_column_text][vc_empty_space height=&#8221;21px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"518\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2022\/03\/Memcached.jpg\" class=\"attachment-full size-full\" alt=\"Memcached\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2022\/03\/Memcached.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2022\/03\/Memcached-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2022\/03\/Memcached-768x411.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2022\/03\/Memcached-620x331.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]While WordPress might support object caching, <strong>you still need an engine to do it for you \u2013 a system that will commit the data to memory and retrieve it when needed<\/strong>. <a href=\"https:\/\/memcached.org\/\" target=\"_blank\" rel=\"noopener\">Memcached<\/a> is that type of system. It\u2019s open-source, which means you\u2019re free to use it as you see fit. It works with distributed memory, which means it can help you pool resources. Its main job is to alleviate database load.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<strong>Using Memcached on your WordPress website gives you several distinct advantages:<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;22px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\">All the caching occurs in RAM, so there\u2019s very little loading of the CPU.<\/span>        <\/div>\n            <\/li>\n<\/ul><ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\">Because the data is cached in RAM, there\u2019s no need to load it from the disk. <\/span>        <\/div>\n            <\/li>\n<\/ul><ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\">You can store all kinds of data with Memcached, although it\u2019s meant for complex data.<\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<strong>The way Memcached works is fairly simple<\/strong>. A user sends a query. The server receives it, and it checks with Memcached to see if the needed data is stored in RAM. If it is, it\u2019s sent directly to the user. If it\u2019s not, Memcached requests it from the database, caches it, and sends it to the user. Neither you nor the user is aware of the process, of course, but you should notice after a while of using Memcached that your website is slightly faster.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<strong>Memcached has other advantages, too.<\/strong> It has a system that keeps the size of the cache under control by removing the least used queries, ensuring that the frequent queries stay cached. Memcached has its disadvantages, too \u2013 restarting the server wipes the cache, which means that you\u2019ll need some time of reduced performance while you build it up again.[\/vc_column_text][vc_empty_space height=&#8221;68px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\"><a id=\"how-to-use-memcached-with-your-wordpress-website\"><\/a>How to Use Memcached with Your WordPress Website<\/h2>\n<p>[\/vc_column_text][vc_empty_space height=&#8221;21px&#8221;]<div class=\"qodef-single-image-holder    \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"553\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2022\/03\/How-to-Use-Memcached-with-Your-WordPress-Website.jpg\" class=\"attachment-full size-full\" alt=\"How to Use Memcached with Your WordPress Website\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2022\/03\/How-to-Use-Memcached-with-Your-WordPress-Website.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2022\/03\/How-to-Use-Memcached-with-Your-WordPress-Website-300x171.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2022\/03\/How-to-Use-Memcached-with-Your-WordPress-Website-768x438.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2022\/03\/How-to-Use-Memcached-with-Your-WordPress-Website-620x354.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Memcached is third-party software \u2013 <strong>it doesn\u2019t come with WordPress, and you\u2019ll have to get it and install it so you can use it.<\/strong> Before you do that, however, you might decide to first test your website\u2019s performance to see how well it\u2019s performing without Memcached.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]There\u2019s a variety of <a href=\"https:\/\/qodeinteractive.com\/magazine\/best-performance-testing-tools-for-wordpress-website\/\">tools for testing your WordPress website<\/a>, and any that can test loading speeds can come in handy. After you\u2019ve chosen one and established a sort of a baseline for your website\u2019s performance, you can move on to the next step.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Memcached isn\u2019t a plugin or an extension you can install on a WordPress website \u2013<strong> it\u2019s software that goes on the server.<\/strong> If you\u2019re not comfortable with messing around the server or if you don\u2019t have access,<strong> the easiest route to go is to contact your hosting provider and ask them whether they can install Memcached for you.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]You might be surprised to learn that it\u2019s already installed \u2013 <strong>many hosts have it, you just might not know it.<\/strong> From there, enabling it is a matter of simply logging into the control panel and finding the control for it. <strong>If you\u2019re not sure what it is or how it\u2019s called, as it might vary from one host to another, contact the support.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]To make sure that Memcached is enabled, you should<strong> log into your SSH terminal via your hosting control panel, and use the Telnet command:<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">telnet [host] [port]<\/pre>\n<p>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]You\u2019ll receive a message saying that you\u2019re connected to localhost, at which point you can use the \u201cstats\u201d command to see some statistics about the connection.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]If you want to and can take the DIY route to install Memcached, you should know a couple of things about it. <strong>Most of the Linux-based systems support Memcached.<\/strong> Many of them will provide their own packages for Memcached, and you should use them to install it as that\u2019ll give you the best result with the least effort.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]The commands you\u2019ll use depend on the system. <strong>For Redhat or Fedora, you\u2019ll use:<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">yum install memcached<\/pre>\n<p>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<strong>For Ubuntu or Debian, you\u2019ll use:<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">apt-get install memcached<\/pre>\n<p>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]If you\u2019re using NGINX, you should know that it comes with a Memcached module.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<strong>The next step would be using caching plugins that support Memcached.<\/strong> There are quite a few of them, and many are out-of-date and seem abandoned. Still, a handful of big caching plugins work with Memcached, so they\u2019re your best bet for setting it up. Plugins such as <a href=\"https:\/\/wordpress.org\/plugins\/litespeed-cache\/\" target=\"_blank\" rel=\"noopener\">Litespeed Cache<\/a> and <a href=\"https:\/\/wordpress.org\/plugins\/w3-total-cache\/\" target=\"_blank\" rel=\"noopener\">W3 Total Cache<\/a> support and provide options for object caching using Memcached.[\/vc_column_text][vc_empty_space height=&#8221;68px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\">Let\u2019s Wrap It Up!<\/h2>\n<p>[\/vc_column_text][vc_column_text]Object caching might be the underdog of the caching techniques to boost website performance. It\u2019s effective, however, and relatively easy to set up and run. The bottom line, however, is that you can never have too many tools if all they do is help you speed up your website. You might as well use Memcached to give your WordPress website that extra boost and make it more competitive.<br \/>\n[\/vc_column_text][\/vc_column][\/vc_row]<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>When looking to speed up your WordPress site, Memcached is a great option. We&#8217;ll show you what it is and how you can use it!<\/p>\n","protected":false},"author":9295,"featured_media":36074,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[236,4,13],"class_list":["post-36064","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-resources","tag-performace","tag-tips","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts\/36064","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/users\/9295"}],"replies":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/comments?post=36064"}],"version-history":[{"count":0,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts\/36064\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/media\/36074"}],"wp:attachment":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/media?parent=36064"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/categories?post=36064"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/tags?post=36064"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}