Speed Up Your Magento

 

We have previously discussed about speeding up your Joomla site and have discovered that there are simple admin or host settings that we can change to improve site performance.

The same methods can also be applied to your Magento site with only slight differences in configuration and settings. Here we have compiled the simplest solutions to improve your Magento site speed. And I am talking about tweaks in .htaccess file and admin settings which are most of the time overlooked beside the fact that these are the most recommended options to optimize your site.

Enable Cache

Login to Magento admin and go to System then access Cache Management. Enable all cache types or those that would apply for your site.

  

Flat Catalogs

If your Magento store has over a thousand of products then we recommend you enable flat catalogs. This will retrieve all your pproducts in one table thus reducing load time of your product catalog.

Here’s how you can do it:

Login to your Magento admin and go to System. Look for the Configuration tab on the right and choose Catalog. Under Frontend tab change both Use Flat Catalog Category and Use Flat Catalog Product to Yes. Then clear your cache.

 

Gzip Compression

Developers swear by the outcome of this method. By simply changing a few lines in .htaccess file your site speed can increase tremendously.

First, enable gzip compression in your index.php file by adding this code at the top:

if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], ‘gzip’))
ob_start(“ob_gzhandler”); else ob_start();

First, enable gzip compression in your index.php file by adding this code at the top:

Then in your .htaccess file find the following lines and replace with the following:

############################################
## enable apache served files compression
## http://developer.yahoo.com/performance/rules.html#gzip
# Insert filter
SetOutputFilter DEFLATE
# Netscape 4.x has some problems…
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# Don’t compress images
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
# Make sure proxies don’t deliver the wrong content
Header append Vary User-Agent env=!dont-vary
# enable resulting html compression
php_flag zlib.output_compression on

Enable KeepAlives

Look for your Apache configuration file usually named as httpd.conf. Locate and replace the following:

KeepAlive On
KeepAliveTimeout 2

Save the file and restart httpd.

Enable JavaScript file merging

Chances are, the bigger your Magento store is the more JS and CSS files there will be. Merging all of it into one file can reduce site loading time.

In your Magento admin navigate to System > Configuration > Developer. On JavaScript Settings change Merge JavaScript Files option to Yes.

  

Database Log Cleaning

Magento has database log cleaning option available but unfortunately it is disabled by default and most of the time web owners don’t enable this option. This feature cleans your log regularly and helps a lot in speeding up your site.

In your Magento admin navigate to System > Configuration. Click on System that is under Advanced then under Log Cleaning change Enable Log Cleaning field to Yes and set Save Log Days to your preference. Save the changes made.


Disable Magento Log

In your admin page navigate to System > Configuration > Advanced > Developer. On Log settings select No for Enabled field.

 

Use Compiler

To enable this navigate to System > Tools > Compilation > choose Enable and click on Run Compilation Process.

Take note though, before you commit modifications, updates or installation on a new extension this option must be disabled first.

  

PHP Configuration

To enable this navigate to System > Tools > Compilation > choose Enable and click on Run Compilation Process.

Open your php.ini file and change the memory limit to 64 MB

Locate your php.ini used by your webserver, e.g.

memory_limit=64M

These are just some of the ways to boost the performance of an ecommerce site running in Magento.

Aside from these we also make use of SiteGround’s SuperCacher with Varnish and CloudFlare CDN.