<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>cache - WP2X</title> <atom:link href="https://wp2x.com/tag/cache/feed/" rel="self" type="application/rss+xml" /><link>https://wp2x.com</link> <description>We can help your Wordpress faster</description> <lastBuildDate>Mon, 28 Sep 2015 10:03:46 +0000</lastBuildDate> <language>en-US</language> <sy:updatePeriod> hourly </sy:updatePeriod> <sy:updateFrequency> 1 </sy:updateFrequency> <generator>https://wordpress.org/?v=5.6.16</generator> <item><title>Install Redis Caching to Speed Up WordPress on Ubuntu</title><link>https://wp2x.com/install-redis-caching-to-speed-up-wordpress-on-ubuntu/</link> <dc:creator><![CDATA[david]]></dc:creator> <pubDate>Mon, 28 Sep 2015 10:03:46 +0000</pubDate> <category><![CDATA[Blog]]></category> <category><![CDATA[Wordpress Tips]]></category> <category><![CDATA[cache]]></category> <category><![CDATA[redis]]></category> <category><![CDATA[wordpress tips]]></category> <category><![CDATA[wordpress tutorial]]></category> <guid
isPermaLink="false">http://wp2x.com/?p=417</guid><description><![CDATA[<p>In this tutorial, Redis will be configured as a cache for WordPress to alleviate the redundant and time-consuming database queries used to render a WordPress page. The result is a WordPress site which is much faster, uses less database resources, and provides a tunable persistent cache. Redis is an open-source key value store that can ...</p><p>The post <a
rel="nofollow" href="https://wp2x.com/install-redis-caching-to-speed-up-wordpress-on-ubuntu/">Install Redis Caching to Speed Up WordPress on Ubuntu</a> appeared first on <a
rel="nofollow" href="https://wp2x.com">WP2X</a>.</p> ]]></description> <content:encoded><![CDATA[<p>In this tutorial, Redis will be configured as a cache for WordPress to alleviate the redundant and time-consuming database queries used to render a WordPress page. The result is a WordPress site which is much faster, uses less database resources, and provides a tunable persistent cache.<span
id="more-417"></span></p><p><a
href="http://wp2x.com/wp-content/uploads/2015/09/redis_cashing_for_wordpress.png?4b2a2c&amp;4b2a2c"><img
loading="lazy" class="aligncenter size-full wp-image-418" src="http://wp2x.com/wp-content/uploads/2015/09/redis_cashing_for_wordpress.png?4b2a2c&amp;4b2a2c" alt="redis_cashing_for_wordpress" width="547" height="338" srcset="https://wp2x.com/wp-content/uploads/2015/09/redis_cashing_for_wordpress.png 547w, https://wp2x.com/wp-content/uploads/2015/09/redis_cashing_for_wordpress-300x185.png 300w" sizes="(max-width: 547px) 100vw, 547px" /></a></p><p>Redis is an open-source key value store that can operate as both an in-memory store and as cache. Redis is a data structure server that can be used as a database server on its own, or paired with a relational database like MySQL to speed things up, as we&#8217;re doing in this tutorial.</p><p>Default WordPress home page without Redis:</p><p>804ms page load time</p><p>Default WordPress home page with Redis:</p><p>449ms page load time</p><h2>Redis vs. Memcached</h2><p>Memcached is also a popular cache choice. However, at this point, Redis does everything Memcached can do, with a much larger feature set. This Stack Overflow page has some general information as an overview or introduction to persons new to Redis.</p><h2>Step 1 — Install Redis</h2><p>In order to use Redis with WordPress, two packages need to be installed: redis-server and php5-redis. The redis-server package provides Redis itself, while the php5-redis package provides a PHP extension for PHP applications like WordPress to communicate with Redis.</p><p>Install the softare:</p><pre class="lang:default decode:true">sudo apt-get install redis-server php5-redis</pre><h2>Step 2 — Configure Redis as a Cache</h2><p>Redis can operate both as a NoSQL database store as well as a cache. For this guide and use case, Redis will be configured as a cache. In order to do this, the following settings are required.</p><p>Edit the file /etc/redis/redis.conf and add the following lines at the bottom:</p><p>Add these lines at the end of the file:</p><pre class="lang:default decode:true ">maxmemory 256mb
maxmemory-policy allkeys-lru</pre><p>When changes are complete, save and close the file.</p><h2>Step 3 — Obtain Redis Cache Backend Script</h2><p>This PHP script for WordPress was originally developed by Eric Mann. It is a Redis object cache backend for WordPress.</p><p>Download the object-cache.php script. This download is from DigitalOcean&#8217;s asset server, but this is a third-party script. You should read the comments in the script to see how it works.</p><p>Download the PHP script:</p><pre class="lang:default decode:true">wget https://assets.digitalocean.com/articles/wordpress_redis/object-cache.php</pre><p>Move the file to the /wp-content directory of your WordPress installation:</p><pre class="lang:default decode:true ">sudo mv object-cache.php /var/www/html/wp-content/</pre><p>Depending on your WordPress installation, your location may be different.</p><h2>Step 4 — Enable Cache Settings in wp-config.php</h2><p>Next, edit the wp-config.php file to add a cache key salt with the name of your site (or any string you would like).</p><pre class="lang:default decode:true ">nano /var/www/html/wp-config.php</pre><p>Add this line at the end of the * Authentication Unique Keys and Salts. section:</p><pre class="lang:default decode:true ">define('WP_CACHE_KEY_SALT', 'example.com');</pre><p>You can use your domain name or another string as the salt.</p><p><strong>Note</strong>: For users hosting more than one WordPress site, each site can share the same Redis installation as long as it has its own unique cache key salt.</p><p>Also, add the following line after the WP_CACHE_KEY_SALT line to create a persistent cache with the Redis object cache plugin:</p><pre class="lang:default decode:true">define('WP_CACHE', true);</pre><p>All together, your file should look like this:</p><p>* Authentication Unique Keys and Salts.</p><pre class="lang:default decode:true ">. . .

define('NONCE_SALT', 'put your unique phrase here');

define('WP_CACHE_KEY_SALT', 'example.com');
define('WP_CACHE', true);
Save and close the file.
</pre><h2>Step 5 — Restart Redis and Apache</h2><p>Finally, restart redis-service and apache2.</p><p>Restart Redis:</p><pre class="lang:default decode:true ">sudo service redis-server restart</pre><p>Restart Apache:</p><pre class="lang:default decode:true ">sudo service apache2 restart</pre><p>Restart php5-fpm if you are using it; this is not part of the basic installation on DigitalOcean:</p><pre class="lang:default decode:true ">sudo service php5-fpm restart</pre><p>That&#8217;s it! Your WordPress site is now using Redis caching. If you check your page load speeds and resource use, you should notice improvements.</p><p>Monitor Redis with redis-cli</p><p>To monitor Redis, use the redis-cli command like so:</p><pre class="lang:default decode:true ">redis-cli monitor</pre><p>When you run this command, you will see the real-time output of Redis serving cached queries. If you don&#8217;t see anything, visit your website and reload a page.</p><p>The post <a
rel="nofollow" href="https://wp2x.com/install-redis-caching-to-speed-up-wordpress-on-ubuntu/">Install Redis Caching to Speed Up WordPress on Ubuntu</a> appeared first on <a
rel="nofollow" href="https://wp2x.com">WP2X</a>.</p> ]]></content:encoded> </item> </channel> </rss>