solutionweb

WordPress Common Errors and Solutions

Solution to the conflict of using Memcached by multiple WordPress sites on the same server

Due to frequent search, Memcached memory cache is opened to reduce the pressure on the server, improve the access speed and improve the user experience. Because it is placed on the same server as my brother’s blog, I automatically jump to the blog address after opening it …

Solution to the conflict of using Memcached by multiple WordPress sites on the same server

Brother Ga wondered, clearly the database is not the same, the database prefix is also different, and the website file is also different. How can it conflict? Later, when I thought about it, I understood that the same memory is used. In this case, it is good to separate the two websites with CACHE_KAY!

Differentiate Memcached cache
Enter the root directory of WordPress site, edit the wp-config.php file under the root directory, and click

/* All right! Please don’t continue editing. Please save this file. Happy to use! */
Add the following code above the code comment.

/* Separated from the server’s multi-site Memcached memory cache-https://www.website-technology.com */
define(‘WP_CACHE_KEY_SALT’, ‘www.website-technology.com’);
www.website-technology.com in the middle of the quotation marks here is just to distinguish the Memcached data from other sites and avoid conflicts. You can change it to your own website or not. Remember to save the wp-config.php file, and then restart it (personal suggestion) and it will be OK!

Back to top