<?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 Archives - Web &amp; Software Development Company | Web Design | Mobile Development</title>
	<atom:link href="https://www.accreteinfo.com/tag/cache/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>Simple, Scalable Smart Software Solutions</description>
	<lastBuildDate>Thu, 09 Dec 2021 08:21:46 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.7</generator>
	<item>
		<title>Using a Redis object cache for WordPress</title>
		<link>https://www.accreteinfo.com/using-redis-object-cache-for-wordpress/</link>
					<comments>https://www.accreteinfo.com/using-redis-object-cache-for-wordpress/#respond</comments>
		
		<dc:creator><![CDATA[Accrete Info Team]]></dc:creator>
		<pubDate>Sat, 13 Feb 2021 06:18:51 +0000</pubDate>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[redis object]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">https://www.accreteinfo.com//?p=215</guid>

					<description><![CDATA[<p>Using a Redis object cache for WordPress is a great way to make your WordPress website faster, especially if you’ve already</p>
<div class="view-full-post"><a href="https://www.accreteinfo.com/using-redis-object-cache-for-wordpress/" class="view-full-post-btn">Read More <i class="fas fa-chevron-right"></i></a></div>
<p>;</p>
<p>The post <a href="https://www.accreteinfo.com/using-redis-object-cache-for-wordpress/">Using a Redis object cache for WordPress</a> appeared first on <a href="https://www.accreteinfo.com">Web &amp; Software Development Company | Web Design | Mobile Development</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Using a Redis object cache for WordPress is a great way to make your WordPress website faster, especially if you’ve already gone through the “Making WordPress Fly” series of tutorials (noted that one commenter there actually mentioned Redis). You’ll need an Ubuntu 14.04 VPS with WordPress already setup on it. You can get an Ubuntu VM here if you don’t have one. You don’t have to use the aforementioned HHVM setup for this tutorial. However, using both HHVM and Redis object caching will give you the fastest load times. I will be releasing another article in the near future about improving HHVM stability for production deployments by using a PHP-FPM failover and an upstart script which does automatic respawning after a crash, something HHVM does not do by default on Ubuntu. Back to Redis – Redis is possibly the best way at present to implement the WordPress object cache. For a long time I have been a proponent of either APC or Memcached in combination W3 Total Cache for the object cache in WP.</p>
<h2>WHY USE A REDIS OBJECT CACHE FOR WORDPRESS?</h2>
<p>During a recent server setup for a new website (My French City) I came across an issue. Caching using APC or Memcached helped with front end speed, but the admin area was painfully slow. This site was a multisite install with domain mapping and hundreds of plugins. There were simply too many queries going on in the backend for it to be snappy. After some searching I discovered that implementing Redis to back the WordPress object cache was a great way to improve backend speed. After implementation it turned out it did a better job on the frontend then W3TC and Memcached, which was a pleasant surprise. HHVM does a great job of speeding up PHP and MariaDB 10.1 is also fast. But on a heavy site like this with lots of plugins, database queries are still the issue. Redis is an elegant NoSQL datastore solution to this problem.</p>
<p>A Redis object cache can be implemented in just a few commands on Ubuntu 14.04. Assuming you already have a working WordPress install (LAMP, LEMP , etc.) the process of getting redis working with WordPress is easy. First connect you your instance via SSH. Once connected:</p>
<div id="crayon-5801e9c212683199609639" class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover">
<div class="crayon-plain-wrap"></div>
<div class="crayon-main">
<table class="crayon-table">
<tbody>
<tr class="crayon-row">
<td class="crayon-nums " data-settings="show">
<div class="crayon-nums-content">
<div class="crayon-num" data-line="crayon-5801e9c212683199609639-1">1</div>
<div class="crayon-num crayon-striped-num" data-line="crayon-5801e9c212683199609639-2">2</div>
</div>
</td>
<td class="crayon-code">
<div class="crayon-pre">
<div id="crayon-5801e9c212683199609639-1" class="crayon-line"><span class="crayon-e">sudo </span><span class="crayon-v">apt</span><span class="crayon-o">&#8211;</span><span class="crayon-e">get </span><span class="crayon-e">update</span></div>
<div id="crayon-5801e9c212683199609639-2" class="crayon-line crayon-striped-line"><span class="crayon-e">sudo </span><span class="crayon-v">apt</span><span class="crayon-o">&#8211;</span><span class="crayon-e">get </span><span class="crayon-e">install </span><span class="crayon-v">redis</span><span class="crayon-o">&#8211;</span><span class="crayon-e">server </span><span class="crayon-v">php5</span><span class="crayon-o">&#8211;</span><span class="crayon-v">redis</span></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Now Redis is installed. To configure a Redis object cache for WordPress there are a few small changes we need to make. Open up /etc/redis/redis.conf then add these two lines at the bottom:</p>
<div id="crayon-5801e9c212694552895761" class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover">
<div class="crayon-plain-wrap"></div>
<div class="crayon-main">
<table class="crayon-table">
<tbody>
<tr class="crayon-row">
<td class="crayon-nums " data-settings="show">
<div class="crayon-nums-content">
<div class="crayon-num" data-line="crayon-5801e9c212694552895761-1">1</div>
<div class="crayon-num crayon-striped-num" data-line="crayon-5801e9c212694552895761-2">2</div>
</div>
</td>
<td class="crayon-code">
<div class="crayon-pre">
<div id="crayon-5801e9c212694552895761-1" class="crayon-line"><span class="crayon-i">maxmemory</span> <span class="crayon-cn">1024mb</span></div>
<div id="crayon-5801e9c212694552895761-2" class="crayon-line crayon-striped-line"><span class="crayon-v">maxmemory</span><span class="crayon-o">&#8211;</span><span class="crayon-e">policy </span><span class="crayon-v">allkeys</span><span class="crayon-o">&#8211;</span><span class="crayon-v">lru</span></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Now you’ll need to make some changes to WordPress. You’ll need to grab this file. Written by Eric Mann this file will allow WordPress to use a Redis object cache for awesome speed improvements. Once you’ve downloaded that file, make sure you disable W3TC object and database cache if you are using either. Now that Redis is running (and PHP knows how to connect to it), it’s time to tell WordPress to use our Redis object cache. You need to open wp-config.php and let WordPress know what host and port Redis runs on, and add a salt to keys. Add these lines:</p>
<div id="crayon-5801e9c21269a716577375" class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover">
<div class="crayon-plain-wrap"></div>
<div class="crayon-main">
<table class="crayon-table">
<tbody>
<tr class="crayon-row">
<td class="crayon-nums " data-settings="show">
<div class="crayon-nums-content">
<div class="crayon-num" data-line="crayon-5801e9c21269a716577375-1">1</div>
<div class="crayon-num crayon-striped-num" data-line="crayon-5801e9c21269a716577375-2">2</div>
</div>
</td>
<td class="crayon-code">
<div class="crayon-pre">
<div id="crayon-5801e9c21269a716577375-1" class="crayon-line"><span class="crayon-e">define</span><span class="crayon-sy">(</span> <span class="crayon-s">&#8216;WP_CACHE_KEY_SALT&#8217;</span><span class="crayon-sy">,</span> <span class="crayon-s">&#8216;mydomain_&#8217;</span> <span class="crayon-sy">)</span><span class="crayon-sy">;</span></div>
<div id="crayon-5801e9c21269a716577375-2" class="crayon-line crayon-striped-line"><span class="crayon-sy">$</span><span class="crayon-v">redis_server</span> <span class="crayon-o">=</span> <span class="crayon-t">array</span><span class="crayon-sy">(</span> <span class="crayon-s">&#8216;host&#8217;</span> <span class="crayon-o">=</span><span class="crayon-o">&gt;</span> <span class="crayon-s">&#8216;127.0.0.1&#8217;</span><span class="crayon-sy">,</span> <span class="crayon-s">&#8216;port&#8217;</span> <span class="crayon-o">=</span><span class="crayon-o">&gt;</span> <span class="crayon-cn">6379</span><span class="crayon-sy">,</span> <span class="crayon-sy">)</span><span class="crayon-sy">;</span></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Then place the file in you downloaded above in webroot/wp-content/object-cache.php, where webroot is the directory your website files are located within. Once this is done make sure the redis-server is running using <span id="crayon-5801e9c21269d461033927" class="crayon-syntax crayon-syntax-inline crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco"><span class="crayon-pre crayon-code"><span class="crayon-e">sudo </span><span class="crayon-e">service </span><span class="crayon-v">redis</span><span class="crayon-o">&#8211;</span><span class="crayon-e">server </span><span class="crayon-v">status</span></span></span> . Now you WordPress site is using a Redis object cache. You should notice significant speed gains once you click through a few pages and the cache is populated with queries. If you want to view the Redis console to see what kind of data is being stored run this command: <span id="crayon-5801e9c2126a1231261515" class="crayon-syntax crayon-syntax-inline crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco"><span class="crayon-pre crayon-code"><span class="crayon-e">sudo </span><span class="crayon-v">redis</span><span class="crayon-o">&#8211;</span><span class="crayon-e">cli </span><span class="crayon-v">monitor</span></span></span> . That will show you a verbose look at what is going on in your Redis cache.</p>
<p>Unfortunately I do not have a control before and after for the speed difference. However here is a Pingdom load test of a page on this website:</p>
<p>I will be writing more about this in the future. Please leave your thoughts or any contributions in the comments below. At that time I may include more detailed information on the performance gains achieved using Redis object cache with WordPress.</p>
<p>The post <a href="https://www.accreteinfo.com/using-redis-object-cache-for-wordpress/">Using a Redis object cache for WordPress</a> appeared first on <a href="https://www.accreteinfo.com">Web &amp; Software Development Company | Web Design | Mobile Development</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.accreteinfo.com/using-redis-object-cache-for-wordpress/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
