What is Memcached?

One question we often get asked at Peter's Web is why should I use Memcached, or what is it in the first place?  The easiest way to explain what Memcached is, is to look at your typical WordPress site. In order to generate pages WordPress queries the database to receive data that it then converts into a web page. In computing terms, querying a database is a slow process, due to the fact that we very rarely require all of the data, so the database has to search for the relevant data and may have to talk to two or more tables in order to get one little bit of information.  This is where Memcached is excellent, once you have generated a page, Memcached will store the output of the query.  Meaning that the next time the same page is requested it can retrieved from the cache rather than querying the database. 

Memcached is made up of four key components:

The client software, which provides locations of where data can be stored

A client based hashing algorithm,  which scrambles the key which makes the storing of data easier. This is highly technical and would probably bore you to death.

Server software, stores the actual data on the server, and is available on all Peter's Web accounts.

LRU (Last Recently Used), manages the storage of the Memcached by deleting those items not recently used.

Each of the four key components is comprised of a key, expiration time, and raw data.  A visitor to your site requests a webpage, which Memcached checks to see if it has been stored in the cache. If it is, the data is loaded from the cache, if not Memcache will need to check the database, subsequently taking longer to load. Whenever information is updated, the Memcached is updated to ensure clients receive up to date content.

This is how you activate Memcached.

  1. Log in to cPanel.
  2. Scroll down and click on Select PHP Version.
  3. Make sure you switch to PHP Extensions.
  4. Find the tick box next to Memcached and ensure it is selected.
  5. If you are running WordPress, ensure you are logged in.
  6. Ensure that you are using LiteSpeed Cache plugin.
  7. Click the Advanced tab at the top of the screen.
  8. Ensure object cache is turned on.
  9. Under Method, select Memcached.
  10. Leave the rest as standard and click save.

Please don't hesitate to get in touch with us here at Peters Web should you require any more guidance on this topic. You can contact us via a support ticket (open a ticket) to our hosting department.

  • wordpress, cache, MYSQL, caching
  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

5 easy steps to keep your Wordpress site safe.....

Wordpress is an incredibly safe application to use, however there are a few ways you can make...

Setting up Wordpress in 10 easy steps

The following article is a brief guide on how to install the software 'WordPress'.  WordPress is...

Back up your Wordpress site

Whenever you are working on a project its always advisable that you save or back up your work at...

Why Wordpress is NOT a forum

Wordpress is a  system which is used to manage the content of your website. It is best used in...

5 turbo steps to speed up your WordPress site

As with all modern websites there is a great emphasis placed on the amount of time taken for a...

Powered by WHMCompleteSolution