Five Magento Speed Tweaks to Turbo Charge Your Magento Store
Magento is right now the most complete and fully featured e-commerce system in our opinion, but unfortunately this does come at a price in performance. Whereas osCommerce, Zencart, CRE Loaded and Virtuemart all perform quite well out of the box, Magento seems slow in comparison. You could say this is a price worth paying for the additional features, but with some steps which we will go into here you will be able to make your Magento store much faster.
We’ll fully explain each tweak and the steps you need to go through to implement these on our hosting, these are all tweaks that you can do yourself without having to contact your hosting company, at least on the NetHosted Platform!
N.B. Click images for full sized versions
-
Setup Magento Caching
This is the first step you can take to speed up your Magento after a fresh install, simply login to Magento as the admin user and go to the System menu and choose Cache Management. Select the following 4 options:
-- Configuration
-- Layouts
-- Block HTML output
-- Translations
and then choose Enable from the dropdown and Submit, as shown below; the other options should not be enabled:
-
Install Fooman Speedster Extension
Fooman Speedster is an amusingly titled Magento extension that can make a serious improvement to your page load times. This extension combines, minifies, compresses and caches your JS/CSS and enables gzip compression for the rest of your pages. This means they are much smaller to download and less http requests need to be made, greatly optimising your page load times.
To start this off in Magento Admin go to System then Magento Connect, then Magento Connect Manager. You’ll have to login again using the admin login at this point, then you will get the Magento Connect Manager screen. Once in here you’ll need to enter the extension key for Fooman Speedster in the box, this is:
magento connect 1.0: magento-community/Fooman_Speedster
magento connect 2.0: https://connect20.magentocommerce.com/community/Fooman_Speedster
Once you have entered this click Install.
You must then add the following to your .htaccess file which you will find in the directory that you installed Magento to:
########################
## Compress, Combine and Cache Javascript/CSS
RewriteRule ^(index.php/)?minify/([^/]+)(/.*.(js|css))$ lib/minify/m.php?f=$3&d=$2
After this your site will be served minified, cached and compressed and you should have noticably faster page loads.
-
Remove Unused Homepage Code
In the Magento Admin section go to the CMS menu and choose Pages. From here click the Home Page that is Enabled, then go to the design view, from here you can delete the contents of the Layout Update XML box, this will not affect anything on the site but speeds up loading a small amount.
-
Use .htaccess Expires
Adding expires to the .htaccess file allow the browser to cache certain resources for an amount of time which will speed up your shop for any returning visitors. To do this add the following lines to the top of the .htaccess file in your Magento install directory:
# turn on the module for this directory
ExpiresActive on
# set default
ExpiresDefault "access plus 24 hours"
ExpiresByType image/jpg "access plus 1 months"
ExpiresByType image/gif "access plus 1 months"
ExpiresByType image/jpeg "access plus 1 months"
ExpiresByType image/png "access plus 1 months"
ExpiresByType text/css "access plus 1 months"
ExpiresByType text/javascript "access plus 1 months"
ExpiresByType application/javascript "access plus 1 months"
ExpiresByType application/x-shockwave-flash "access plus 1 months"
-
Enable Flat Categories and Flat Products
This is the final tweak that will make your Magento store a little faster, to do this in Magento Admin go System then Index Management. From here you should Reindex the Product Flat Data and Category Flat Data. Once this is done go to System then Configuration and choose the Catalog option on the left. You should then set the Use Flat Catalog Category and Use Flat Catalog Product both to Yes.
With these speed tweaks implemented your Magento site should run noticably quicker, we have ourselves made many optimisations our end to PHP, MySQL and Apache so that you won’t find faster Magento hosting anywhere!