6 Useful Tips to Speed up your Magento store

Magento – is one of the most popular e-commerce system in the World. It's really great, very customizable and provide a tone of very useful features out of the box. However, nothing is ideal in this World, and main disadvantages of this system is pretty low loading speed with growing of the store.

If you are reading this article, I am pretty sure you already fill it. So, what step you can do to make your Magento store faster.

Let's start from simplest ones and go to more difficult:

  1. Ensure that you have enabled flat tables for catalog.

    Go to System->Configuration->Catalog and select Front-end. Ensure that you have “Use Flat Catalog Category» and “Use Flat Catalog Product “ set to Yes

Do not forget to do full indexation after you will enable it. You will see real speed enhancement in category and product detailed view page

2) Ensure that you have cache enabled. That should be even first step to do. Go to System->Cache management, click “Select all” and make “Enabled” in mass action selector.

The thing is Magento pretty hard system for server resource. For example for each call it go throw all installed modules and generate complete layout XML (gathering it peace by peace). After that it processing logic for retrieving data from DB, than for each block and renders it. And now imaging that next time we do not do all this “hard” thing, and just reuse results from previous call. Just like all day you bake a cookies and when needed just get it from the pocket. Should be much faster than bake it each time, isn't it? Absolutely same case we have in Magento

  1. Enable Magento calculation. Next step will be make “pre-coocked” cookies for PHP code. In Magento it calls “compilation”. One time magento “glue” all the code in few files, so next time when we run some page – Magento does not need to search components for Auto Loading and just find everything that needs much faster

    To enable it you should go to System->Tools->Compilation and click to “Run Compilation Process” (do not forget to click Enable after that)

  1. Reduce numbers of the logs that keeps in Database. By default magento database growing pretty fast and pretty large. I have seen databases that took about 20 Gb, and without deep fine tuning of the code – the site would just not load.. ever :) However I am pretty sure this is very special case and not related to you. So, what we can do to prevent database to grow so fast.. Magento keeps logs by default for 180 days. In most cases it's not needed, and you can easy reduce this period for 2 weeks. Go to System->Configuration->System->Log and set “Save Logs, days” to what amount you want. Do not forget to save your changes

  1. All previous steps was affecting to so called First Bite time (time when your server calculate everything that needs and start to transfer data to the browser). But when HTML of the page is generated – it start loading JS, CSS and images. You would probably see very often, when page start loading, and than like a freeze on some point. The cause of it - the browser is loading images. CSS and JS. What we can do with it? For our luck, magento had out of the box solutions, that calls Merging. It merge all JS and CSS files into few big peaces, and so they loaded much faster. To enable it – you should go to System->Configuration->System->Developer and set values to Yes for “Merge Javascript Files” and “Merge CSS Fields”.

    As about the image – unfortunately Magento does not provide out of box tools to optimize it, so you should it manually or install 3rd party modules to take care about it.

  2. So, I think that are all good tools that kindly provided by Magento from out of the box. But I can not mention some more steps that can be taken and that have probably equal effect to all previous steps. From my opinion, without Full Page Cache – no one big Magento store would ever exist. Few words what is it and how it works. You remember how I described useful effect of Magento cache for speed loading. It's really good, but some time and resource are still spend to get all pices together, check if cache already exist, get html for each block from cache step-by-step. And now imagine that we put complete page into pocket and take it whenever it's needed even without calling Magento at all. Cool Isn't it? One of my friend told me once “why do all that sh..t…just use FPC (Full Page Cache)…who cares if Magento is running really badly» :) And he was right, it works really impressive. As FPC solution you can check some Magento modules (btw, Magento Enterprise includes it) or some 3rd party Solutions like Varnish.

    Now you probably will tell me – why than we should use something else, FPC is ideal solution, it's really easy and cool. However, not all so good as imaging for fast look. The thing is FPC need to load page from Magento first time after cache is cleared – so, if you page loading is about 60 sec, it will be not good for first user. Second issue – some pages can not be used by FPC (for example checkout, customer profile, etc..), as it should be individual for each user/loading.

What can we do in case if we apply everything from below and site is still slow? In this case I think the best way would be call to the professionals, as here should be done very deep analyze of code that installed. From our experience – we do following on this step:

  • make complete profiling of the site with special tools

  • make analyze of profiler info

  • make fixes to the “bottle neck” code

  • analyze what else tools can be used in this special case for enhance loading speed (APC, Xcache, eAccelerator, etc...)

Hope my topic will be helpful for some one. In case you still not able to fix speed issue – welcome to contact us, we will help you.