How to Speed Up Your Magento Website

In this post, I am going to show you how to speed up your Magento website performance using some simple tricks.

Latest Version:

Make sure you are running the latest version of Magento because new releases generally contain bug fixes and performance improvements.

Flat Catalog:

Magento uses the EAV (Entity Attribute Value) structure to store customer and product data.
So the data has been stored in many tables. Because of this, the SQL queries will be longer and more reads. While enabling the Flat Catalog for Categories and Products, the data will be merged into one table. This will improve the performance of the Magento store. If your Magento store has more than 1000 products, this can very beneficial.

We can enable Flat Catalog on Magento admin panel using the below path,

Go to: System > Configuration > Catalog (Under CATALOG) > Front End

Here, use the below option to enable the flat catalog:

  • Use Flat Catalog Category: Yes / No
  • Use Flat Catalog Product: Yes / No

Combine JS and CSS files:

Magento has an inbuilt feature to merge all CSS and Javascript files into one file. This will reduce the total number of HTTP requests and in turn help speed up the loading of the Magento website.

We can merge JS and CSS files on Magento admin panel using the below path,

For Merge JS files, go to: System > Configuration > Developer (Under ADVANCED) > Under “Javascript Settings”, change “Merge Javascript Files” to “Yes”.

For Merge CSS files, go to: System > Configuration > Developer (Under ADVANCED) > Under “CSS Settings”, change “Merge CSS Files” to “Yes”.

Enable Magento Compilation:

By default in Magento, while the page loads, the application files are searched in a certain order, which results in a lot of filesystem reads. This Magento compiler used to reduce these reads by copying all of these files into a single include directory and also caches the most frequently used pages.

We can enable Magento compilation on Magento admin panel using the below path,

Go to: System > Tools > Compilation > Click on “Run Compilation Process”.

Clean Up Magento Database & Logs:

By default, Magento keeps logs up to 180 days. This will increase your database size quite large. So we have to change it something smaller like two weeks (14 days) to save the database space.

We can enable the log cleaning on Magento admin panel using the below path,

Go to: System > Configuration > System (Under ADVANCED) > Log, change “Enable Log Cleaning” to “Yes” and configure the “Save Log”, “Days” for 14 days.

You can also manually clean up your database by emptying the log tables.
You can also manually clean up the database by logging in to your Magento database, and emptying the below log tables:

  • log_customer
  • log_quote
  • log_summary_type
  • log_url
  • log_url_info
  • log_visitor
  • log_visitor_info
  • log_visitor_online

Limit Extensions & Modules:

If you have installed any modules on your Magento store, that is not in use, then disable it. Because it helps to increases the loading time of the website.

We can disable the unwanted modules on Magento admin panel using the below path,

Go to: System > Configuration > Advanced (Under ADVANCED) > On the modules list, select “Disable” from the drop-down box and click on “Save Config”.

Enable caching:

Magento has inbuilt cache mechanism. We can enable it on Magento admin panel using the below path,

Go to: System > Cache Management.

Gzip Compression:

This is used to compress the web pages and stylesheets at the server level before sending them over to the browser.

To enable Gzip Compression, open .htaccess file which is already available in your Magento root directory and uncomment the below code,

## enable resulting html compression
 #php_flag zlib.output_compression on

Like,

## enable resulting html compression
  php_flag zlib.output_compression on

Enable Output Compression:

This section will turn on the Apache mod_deflate module, which is used to compress the text, CSS, and javascript before it is sent to the browser. This helps to reduce the page download size. To enable this, simply uncomment the appropriate lines in the .htaccess file which is already available in your Magento root directory.

<IfModule mod_deflate.c>
############################################
## enable apache served files compression
## http://developer.yahoo.com/performance/rules.html#gzip

# Insert filter on all content
 SetOutputFilter DEFLATE
 # Insert filter on selected content types only
 AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript

# 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
</IfModule>

Enable Expires Headers:

Generally, browsers use Expires headers to determine how long a page component can be cached. Static components such as images should have headers like far-future expires, but essentially, every page components should have expires headers. To enable this feature, simply uncomment the appropriate line and write “ExpiresActiveOn” just above it in .htaccess file which is already available in your Magento root directory.

############################################
## Add default Expires header
## http://developer.yahoo.com/performance/rules.html#expires
 
 ExpiresActive On
 ExpiresDefault "access plus 1 year"

Disable ETags:

ETags are used by the browsers to determine cached components across subsequent visits. They can slow down a website served from a cluster if the cluster has not implemented them properly. It is best to just turn off in .htaccess file which is already available in your Magento root directory.

############################################
## If running in cluster environment, uncomment this
## http://developer.yahoo.com/performance/rules.html#etags

FileETag none

Hope this helps.

Leave a Reply

Your email address will not be published. Required fields are marked *