Magento Site Performance Optimization

From Brian Nelson Ramblings
Revision as of 19:55, 27 April 2014 by Brian (Talk | contribs) (Created page with "==Magento Site Performance Optimization== Magento out of the box is pretty quick with around 3-5 second load times. But after you start adding extensions, products, and imag...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Magento Site Performance Optimization

Magento out of the box is pretty quick with around 3-5 second load times. But after you start adding extensions, products, and images to your site it can start to slow down. At this point you will want to start optimizing your code and looking for ways to impprove your stores overall performance.

Here is a generic list that will help you site to get around 2-3 load times, depending on your systems resources.

1. Enable Magento caching

This can be done in your Magento admin control panel. Enable all available caches

2. Compress Images

This should be done on every image before uploading to the server. Your server could also have command line tools that will help compress your images and make all images progressive. This will help with speed your images are loaded.

3. Diable any unused Magneto extensions

This should be a no brianer, but I have seen many stores that do not disable their unused extension. When an extension is enable, the system will process those extension with every page load, disabling them or better yet removing them will result in faster load times.

4. Compress all Output

In your php settings you can enable zlib.output_compression, this can save you on bandwidth and increase your sites loading times. As you can reduce up to 80% of your sites output, which means faster load times. Also enabling mod_deflate in your apache/.htacess file will compress objects not passed by php, examples js, css and other plain text files.

5. Use mod_expires

Using mod_expires will allow your content to be saved/cached on the remote system which will increase your users load times by elimiting requests to the same objects.

6. Look for 404 errors

Magento has a build in 404 page, when objects like css files or images are missing it causes additional process to spawn and will slow down your sites load times.

7. Disable Magento Logging

Within the Magento configuration, you can enable logging under the Developers-tab. Depending on the Magento modules this could lead to more logs needed to be written to the filesystem, slowing down your shop. Because the logging-abilities are only needed to debug something, in daily usage, it's best to disable logging altogether.

8. Merge CSS and JavaScript

By merging all CSS and JavaScript files together as one big file, only one single HTTP-request is needed by the browser to fetch this content. This saves bandwidth. For this merging, the FooMan Speedster module could be used. Magento 1.4 contains an option to merge CSS, while JavaScript-files are merged by default. Besides merging, crunching is also an option offered by FooMan Speedster: It removes whitespaces from the output, but when compression is already applied to CSS, this option is less needed.

9. Log Cleaning/Databae Optimization

Wow, this a big one. You will want to clean the logs and optimize your database weekly or monthly depending on the amout of traffic you recieve. Doing this can increase the site load time and keep your site stable. I have created a set of scripts that will do this for you. You can find them at Here

10. Use a CDN with Magento

Using a CDN for your static assets is easy to configure within in your Magento admin panel. This will help your customers with loading assets from servers closer to their geographic locations and helps reduce the load on your server.

If you have any other tips or tricks to speed up Magment let me know and I will include them on this list.