How to Use Memcached For Your WordPress Website?

An Introduction to Memcached

Every MySQL query you perform takes valuable time, CPU power, and is often redundant when you’re executing the same queries over and over. The main goal when using memcached for your site/software is to improve performance as much as possible. This is accomplished by using memcached to cache your MySQL queries, which in theory should cut out the most resource intensive aspect of most PHP/MySQL based sites. Instead of querying the database directly for each request, which can be incredibly taxing, memcached will cache your most common queries and serve them from memory.

This concept is no different than using RAM on your local computer compared to accessing your hard drive. RAM (memory) is incredibly efficient for frequently accessed programs like web browsers, email clients, video games, etc. Accessing those same programs from disk every time would have a very negative and very noticeable impact on performance. Using this example you’ll begin to see why it’s so much more efficient to store those MySQL queries in memory instead of hitting your database each time.

How to enabled Memcached On Your Hosting Account?

Enabling memcached could not be simpler! Especially to Hawkhost customer, Hawkhost have integrated the feature right into cPanel, so you’re quite literally one click away from being able to use memcached on your supported software. To get started, login to cPanel and search for ‘memcached’. Once you’ve loaded up the interface, all you need to do is hit ‘Start Memcached’. That’s it!

Now any time you visit your memcached interface you’ll see it’s running.

WordPress Setup for Ready Memcached

You can install W3 Total Cache to use memcached. In General menu, Enable Page  cache and choose memcached. After that click save all settings.

Next step, Go to page cache menu. In advanced tab, you can configure memcached. When you successfully configure memcached in W3TC you can run a test and you’ll see the output like this screenshot shows:




You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *