WordPress enables Memcache to accelerate page loading

Source: Internet
Author: User
Tags memcached php file

Most webmasters who use Wordpress to build websites use dynamic pages or pseudo-static pages. When users request pages, they will inevitably read content from the database, slowing the page loading speed. If the traffic is too large, frequent operations on the database will also increase the load on the database and server. If your server supports Memcache, we recommend that you enable Memcache to accelerate Wordpress page loading and reduce database load.

Memcache is a high-performance distributed memory object cache system. In dynamic applications, Memcache can accelerate page loading and effectively reduce database load. In WordPress, Memcache uses Memcache to write the WordPress Object Cache to the memory. It will be read directly from the memory next time. Compared with reading data directly from the database, or saving the Object Cache data to a file, and then reading data from the hard disk, Memcache has a great speed advantage.

WordPress supports Object Cache by default, so it is convenient for Wordpress to enable Memcache. The steps are as follows:

1. Your server needs to support Memcache. WDCP, LNMP, and LAMP one-key installation packages all contain the Memcache plug-in. You can choose to install it.

2. Download the Memcache plug-in from the Wordpress website.

3. Copy the downloaded object-cache.php file to the wp-content directory, be sure not to put it under wp-content/plugins.

WordPress automatically checks if there is a object-cache.php file under the wp-content directory, and if this file exists, the Wordpress object caching mechanism is automatically enabled. Refresh the page to see if the speed is much faster.

Additional reading:

Do not worry about 500 error, you can view the specific error information by opening the debug mode of wordpress, the specific method is to find the wp-config.php under the Wordpress root directory, and find

Define ('WP _ debug', false );

Modify it:

Define ('WP _ debug', true );

When you open the website again, the following error message is returned:

Fatal error: Class 'memcac' not found in/wp-content/object-cache.php on line 372

This is because Memcache is not installed on the server. Originally, the Memcached installation script was provided in the LNMP installation package. During the installation, you will be asked to choose whether to install Memcache or Memcached. Because Memcached is installed, the server returns a 500 error after Wordpress enables Memcache. After you uninstall Memcached and choose to install Memcache, Memcache Cache Acceleration is enabled for Wordpress.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.