<?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>magento optimisation Archives - gj</title>
	<atom:link href="https://blog.gaiterjones.com/tag/magento-optimisation/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.gaiterjones.com/tag/magento-optimisation/</link>
	<description>gaiterjones</description>
	<lastBuildDate>Wed, 27 May 2015 14:23:40 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.3</generator>
	<item>
		<title>5 Ways to Improve Magento Page Speed</title>
		<link>https://blog.gaiterjones.com/5-ways-to-improve-magento-page-speed/</link>
					<comments>https://blog.gaiterjones.com/5-ways-to-improve-magento-page-speed/#comments</comments>
		
		<dc:creator><![CDATA[PAJ]]></dc:creator>
		<pubDate>Tue, 26 May 2015 15:11:34 +0000</pubDate>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[Magento Optimisation]]></category>
		<category><![CDATA[google page speed insights]]></category>
		<category><![CDATA[magento optimisation]]></category>
		<guid isPermaLink="false">http://blog.gaiterjones.com/?p=1293</guid>

					<description><![CDATA[Googles Phantom update recently laid emphasis on having a more mobile friendly website to improve search results on mobile devices. This is great for Magento 1.9 with it&#8217;s responsive theme...<a class="more-link" href="https://blog.gaiterjones.com/5-ways-to-improve-magento-page-speed/" title="Continue reading">Continue reading</a>]]></description>
										<content:encoded><![CDATA[<p>Googles Phantom update recently laid emphasis on having a more mobile friendly website to improve search results on mobile devices. This is great for Magento 1.9 with it&#8217;s responsive theme design but if your Magento page load speed is slow you may well be penalised by Google.</p>
<h2>Google Page Speed Insights</h2>
<p>The <a href="https://developers.google.com/speed/pagespeed/insights/?" target="_blank">Google Page Speed insights tool</a> gives you a good idea as to how your Magento site is performing according to Google&#8217;s page speed analysis rules. It will rate your page speed for both Desktop and Mobile devices on a scale between 1 and 100, the higher the rating the better. Apart from the general response speed of your server it concentrates on some basic optimisation rules including compression and browser caching.</p>
<p>Google will provide you with some guidance to help you improve your page speed analysis results. The main speed issues all Magento stores are going to suffer from will, despite all your optimisation attempts, probably always eventually come back to your server hardware resources and configuration. The mean time to the first byte delivery for a Magento store will be very dependant on server, database and network resources that may be out of your control (or budget) especially as Magento is already a pretty data intensive beast.</p>
<p>Here are 5 ways to <strong>improve your Magento Google Page Speed insight results</strong>.</p>
<h2>1. Buy a new server / enable full page caching</h2>
<p>Ok, so a new server is probably not going to be an option, but remember if your server is not up to spec for your Magento installation no amount of optimising is going to make your server faster. Full page caching might be an option to help improve server response times.</p>
<h2>2. Enable Apache Compression</h2>
<p>Assuming you are using Apache, make sure compression and the <strong>mod_deflate</strong> module is enabled. mod_deflate is an Apache module which “provides the DEFLATE output filter that allows output from your server to be compressed before being sent to the client over the network.” (from its web). You need to make sure the module is enabled before you try to configure compression. To do this with Ubuntu for example simply enter</p>
<pre class="prettyprint"><code>a2enmod deflate
service apache2 restart</code></pre>
<p>Now take a look at the default Magento .htaccess file in the root of your Magento folder,  Make sure the section with the deflate compression rules is not commented to enable the default compression rules.</p>
<pre class="prettyprint"><code>############################################
## DEFLATE COMPRESSION
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript
    AddOutputFilterByType DEFLATE application/xml application/xhtml+xml application/rss+xml
    AddOutputFilterByType DEFLATE application/javascript application/x-javascript
    #AddOutputFilterByType DEFLATE application/x-httpd-php

    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html

    SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
    SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
    SetEnvIfNoCase Request_URI \.(?:pdf|doc)$ no-gzip dont-vary
    SetEnvIfNoCase Request_URI \.(?:avi|mov|mp3|mp4|rm)$ no-gzip dont-vary
</code></pre>
<p>These are the default rules, if you google this subject you will also find suggestions to improve on / customise these rules. Some will also argue that you should move the .htaccess rules to your apache site .conf file.</p>
<h2>3. Enable Browser Cache Rules</h2>
<p>Similar to taking advantage of Apaches compression features, you need to also make sure you are telling visitors what data their browsers can and cannot cache, and for how long. Client side caching rules obviously help considerably to reduce the time required by the browser to fetch data.</p>
<p>The Apache module is called mod_expires. Enable this with</p>
<pre class="prettyprint"><code>a2enmod expires
service apache2 restart</code></pre>
<p>Again look at the default Magento .htaccess rules and make sure the <strong>mod_expires</strong> section is not commented out.</p>
<pre class="prettyprint"><code>
############################################
## Add default Expires header
## http://developer.yahoo.com/performance/rules.html#expires

	ExpiresActive On
	ExpiresDefault "access plus 1 year"


</code></pre>
<h2>4. Optimise images</h2>
<p>The first thing you will see when Google analyses your product pages are suggestions to improve image optimisation. A good Magento store will have a lot of images, and Magento makes a good job of resizing and caching product images for various frontend views.</p>
<p>There are two really good lossless image optimisation tools available that can optimise all your images in seconds with just one command line: <strong>jpegoptim</strong> and <strong>pngcrush</strong>.</p>
<p>These are free utilities that should be available for your flavour of Unix. In ubuntu you can install them with</p>
<pre class="prettyprint"><code>apt-get install jpegoptim
apt-get install pngcrush</code></pre>
<p>First take a backup of your Magento installation, or at least your <em>/media/catalog/product</em> and <em>category</em> folders.</p>
<p>To optimise every single product image open a terminal session and change to your magento<em> media/catalog/product</em> folder. Now execute the following command line</p>
<pre class="prettyprint"><code>find . -type d -exec  sh -c "/usr/bin/jpegoptim --strip-all -t {}/*.jpg" \; | perl -e '@a=&lt;&gt;; $a=join("", @a); @b = $a =~ /%\s+\((\d+)k\)/g; foreach my $n (@b) {$sum = $sum + $n}; print "Total saved ${sum}k\n"' </code></pre>
<p>This will optimise all jpg files in the current folder and all subfolders. The original file will be overwritten and a summary of the compression savings shown at the end. Be sure to reset the permissions of all the image files after running the optimisation as they will have all been reset which can lead to them not being accessible by Apache.</p>
<p>If you have png files you want to optimise the corresponding pngcrush command is</p>
<pre class="prettyprint"><code>for png in `find $1 -iname "*.png"`; do pngcrush -ow "$png"; done</code></pre>
<p>Before you jump in and optimise all your images make sure you have a backup, and I would also do a test optimisation on your production server. Replacing thousands of broken product images is really no fun at all.</p>
<p>&nbsp;</p>
<h2>5. Minify and Optimise JS, CSS and HTML</h2>
<p>The best way to minify and optimise your javascript and style sheet files for Google page insights is to enable the Magento js and css combination feature in admin. I would also recommend installing the <a href="https://blog.gaiterjones.com/5-magento-modules-you-cannot-live-without/">Fooman Speedster Advanced</a> module. I noticed the new RWD theme in Magento 1.9 now supports SASS, this will no doubt help to improve CSS optimisation in the future, if your theme doesn&#8217;t support SCSS then have a look at manually optimising the CSS yourself using online tools. The same goes for javascript, make sure any plugins you install are using minified js files, or try to minify the source yourself using online tools.</p>
<p>I am currently testing a <a href="https://github.com/gaiterjones/magento-minifyhtml" target="_blank">module</a> that uses the well known minify code to minify Magento html output.</p>
<p>Each of these steps will help to improve the page speed insight score, html minification alone increases the rank by 1. When you add all these small improvements together your page speed rank will increase by 5 to 10 points which may well be enough to get you in to the green ranking of 85 and above.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.gaiterjones.com/5-ways-to-improve-magento-page-speed/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
