Last update at :2024-02-12,Edit by888u
Introduction
Memcached is a high-performance distributed memory object caching system used in dynamic web applications to reduce database load. It improves the speed of dynamic, database-driven websites by caching data and objects in memory to reduce the number of database reads. To put it bluntly, it is to cache the information that originally needs to be read from the hard disk (database and other information by default) into the memory, thereby improving the speed of the website. As we all know, the reading speed of memory is N times that of hard disk. WP has many cache plug-ins, but they basically save the cache on the hard disk. Although it can also reduce the pressure on the server, the retrieval speed is far slower than reading from memory. Speed comes quickly, and Memcached is designed to solve this problem. (Since the memory is volatile memory, the cached data will be cleared after a power outage or restart of the server.)
Memcached activation tutorial
There are three main steps:
1. Install the Memcached service on the server. 2. Install the Memcached client on the server. 3. Install the corresponding extension for WordPress. I won’t go into the first two steps of installing the Memcached service and client. There are still many tutorials on the Internet, you can search for them. My server environment is configured using Junge lnmp.org, so to install the Memcached service and client in the first two steps, just follow the methods provided in Junge's blog.
It should be noted that there are two Memcached clients: php memcache and php memcached. The two names only differ by one letter "d". I chose the second one, which is php memcached. Depending on the choice of this step, step 3 will also be different.
Install the corresponding extension for WordPress (Important! Please select the corresponding extension according to the client installed earlier!)
php memcache can be downloaded: https://wordpress.org/plugins/memcached/
php memcached can be downloaded: https://wordpress.org/plugins/memcached-redux/
There is no need to download and install in the background plug-in. Open the web page to download directly, then unzip it, and put the object-cache.php file in the unzipped folder into the wp-content folder of the website directory. Note that it is not wp- content/plugins/!
At this step, the configuration of Memcached is completed. WordPress will automatically check whether there is an object-cache.php file in the wp-content directory. If there is, it will directly call it as the WordPress object caching mechanism. Download the tool at the end of the article to view Memcached usage, such as usage rate and hit rate. After downloading, place the decompressed file memcached.php in any accessible location, such as the website root directory/memcached.php, and visit http://your domain name/memcached.php to view it.
You will be prompted to enter your username and password. Default username: memcache Default password: password
define('ADMIN_USERNAME','memcache'); // Admin Username define('ADMIN_PASSWORD','password'); // Admin PasswordTo modify the username and password, you can modify memcached.php and search (about lines 22 and 23)
Change memcache and password respectively to the username and password you want to set.
Recommended site search: domain name registration query, free overseas server, free overseas server, .net virtual host, free mainland China space, vps foreign server, independent ip host, cheap virtual host, ip reverse check, domain name check,
p>
发表评论