Speed Up your Magento Store from Slow to Insanely Fast

Time and again it has been proven that Magento is the leading e-commerce platform. Enriched with a host of features, easy to use functionality, great third party support, Magento offers great extensions and customization options.

What do we love in Magento? It’s amazing functionalities.
What do we hate in Magento? It’s pathetic slow speed.

Speed Up your Magento store from slow to insanely fast

Well, if we are using Magento without setting it up for optimal performance in a shared hosting, we shouldn’t be blaming Magento for speed issues. There are different setups which can optimize Magento performance and boost the speed of Magento Store. Let’s find out how!

Tips to Speed Up Magento Performance

Editing .htaccess file:

Some secret of Speeding up Magento is hidden in its .htaccess file itself.  You need to carefully edit .htaccess file as given in the instructions below:

Enable Output Compression:

This mod to speed up Magento will only work if mod_deflate apache module is already installed on your server. Enabling output compression compresses text, CSS and JavaScript before it is sent to the browser. This results in a smaller download size of all the components for the browser, so Magento pages load faster. To enable output compression, find the following lines in you .htaccess file and just uncomment the appropriate lines, which will finally look like following:

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

Enable Expires Headers

Expires Headers are used by the browser to determine how long a page component can be cached. Expires headers are most often used with images, but they should be used on all components including scripts, stylesheets and Flash..

Keep in mind, if you use a far future Expires Header you have to change the component’s filename whenever the component changes. Using a far future Expires Header affects page views only after a user has already visited your site. It has no effect on the number of HTTP requests when a user visits your site for the first time and the browser’s cache is empty. By using a far future Expires header, you increase the number of components that are cached by the browser and re-used on subsequent page views without sending a single byte over the user’s Internet connection.

To Add Expires Header, find the following line in your .htaccess file and uncomment the line if it’s commented and add “ExpiresActive on” above it.

integrate-magento-with-ERP-2

Find the following line in your .htaccess file and uncomment the line if it’s commented and add “ExpiresActive on” above it.


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

ETags are a way for browsers to validate cached components across subsequent visits. They can slow down a site served from a cluster if the cluster hasn’t implemented them properly. It is best to just turn them off by setting “FileETag none”.

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

Change default setting from Magento Admin:

Until now to speed up our Magento Webstore we made the modifications only in the Magento .htaccess files. To take this further we will now look into ……..Magento Admin settings.

Merge CSS and Javascript files

The following settings will merge the CSS and Javascript files, which in turn will help to minimize the HTTP request and make the response faster:

  • Magento admin -> System Configuration -> Developer -> Under “Javascript Settings”, change “Merge Javascript Files” to YES.
  • Magento admin -> System Configuration -> Developer -> Under “CSS Settings”, change “Merge CSS Files” to YES
  • Clear cache

Enable Flat Catalo

Magento uses the EAV model to store customer and product data. Enabling the Flat Catalog for Categories and Products merges product data into one table, thereby improving performance by responding to queries faster. If your store have more than 1000 products. You should enable Flat Catalog Products.

  • In the Magento Admin, go to System > Configuration > Catalog.
  • Under “Frontend”, change “Use Flat Catalog Category” to YES.
  • Under “Frontend”, change “Use Flat Catalog Product” to YES. (optional)
  • Clear the cache.

Enable the Magento compiler (Mage_Compiler)

Important Note: If custom extensions are being used in your Magento webstore, enabling the Magento Compiler may break the store. Use this with precaution. We would not be responsible if something goes wrong.
Magento’s application files are searched in the following order:

  • In the Magento Admin, go to System > Configuration > Catalog.
  • Under “Frontend”, change “Use Flat Catalog Category” to YES.
  • Under “Frontend”, change “Use Flat Catalog Product” to YES. (optional)
  • Clear the cache.

This search is performed every time a page loads, resulting in a lot of filesystem reads. Enabling the Mage_Compiler reduces the number of reads by copying all of the application files to a single include directory. It also caches the most frequently used pages.

1. In the Magento Admin, go to System > Tools > Compilation.
2. Click “Run Compilation Process”

Log cleaning via admin

1. In the Magento Admin, go to System > Configuration.
2. In the left menu under Advanced, click System.
3. Under “Log Cleaning”, change “Enable Log Cleaning” to “yes” and configure the Save Log for 14 days:

magento

Clean Magento database

Cleaning the database Magento time-to-time improves the performance and site load speed of your Magento eCommerce Site. You can manually clean up the database by logging in to your Magento database, and truncating the following tables:

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

If implemented correctly these simple tips will help you speed up Magento store performance. Magento performance optimization guarantees that your ecommerce website will become insanely fast. Also, along with the tips, please try to ensure the following:

1. Take a dedicated SSD hosting server.
2. Use external cache such as Varnish.
3. Use CDN for your site elements.

The main conclusion is, you need to configure your Magento system and get a high performing hosting server properly optimized to get an awesomely performing Magento e-commerce store.

If you think we need to add something else to the list, don’t hesitate to write it in the comments below and also let us know if you have questions regarding implementation of the above steps. Ciao.integrate-magento-with-ERP-2

You may also like:
Magento 2.0 Advanced Pricing
Top 7 Magento Extensions in 2017 for Your eCommerce Store
How to Maintain Multi-Warehouse Stock in Magento?

Subrata Bauri

I am a Magento developer at InSync and spend most of my time reading books(weird ones). Ask me anything on Twitter @SubrataBauri and I will answer it personally.

  • its worth noting that by cleaning log_* tables the one could loose the sales history that could be used for sales analytics

    • Anurag

      Hi konstantin, for sales reports you can use google analytics for your magento.

  • its worth noting that by cleaning log_* tables the one could loose the sales history that could be used for sales analytics

    • Hi konstantin, for sales reports you can use google analytics for your magento.

  • Performance is the most important part for ecommerce website. If your web store response slow, it’s effect on your sale. Magento is the one of the best ecommerce framework but like other framework Magento has also performance issue. When you searching in google regarding Magento performance you found many complains.

    With this article you can easily optimize your Magento performance in 7 easiest steps: http://www.cloudways.com/blog/magento-website-performance-optimization-tips/

    • Soumitra Chakraborty

      Hi Fahad,
      Thanks for sharing the link.

  • Fahad (Eddie)

    Performance is the most important part for ecommerce website. If your web store response slow, it’s effect on your sale. Magento is the one of the best ecommerce framework but like other framework Magento has also performance issue. When you searching in google regarding Magento performance you found many complains.

    With this article you can easily optimize your Magento performance in 7 easiest steps: http://www.cloudways.com/blog/magento-website-performance-optimization-tips/

    • Soumitra Chakraborty

      Hi Fahad,
      Thanks for sharing the link.

      • Fahad (Eddie)

        You’re Welcome 🙂

  • Hi Subrata, Great guide. When you next look at this post, considering adding image optimization tools to the list. You can get a massive improvement in the performance and a reduction of around 80% in page weight by doing this.

    Keep up the good work

  • Hi Subrata, Great guide. When you next look at this post, considering adding image optimization tools to the list. You can get a massive improvement in the performance and a reduction of around 80% in page weight by doing this.

    Keep up the good work

  • peter jackson

    Absolutely the admin settings such as database cleanup, make changes on merge settings of Css, JS files etc, will surely improvise the site performance. I got a source, http://bit.ly/1JOw0jF where I found some metrics about website speed optimization.

  • peter jackson

    Absolutely the admin settings such as database cleanup, make changes on merge settings of Css, JS files etc, will surely improvise the site performance. I got a source, http://bit.ly/1JOw0jF where I found some metrics about website speed optimization.

  • Brian Mason

    great!

  • Brian Mason

    Everybody knows that Magento is a little bit slower. Tuning up Magento website without help from a developer or hosting provider is like a non-professional activity. I also had the same problem and decided to hire good developer here .You know result is great!

  • Brian Mason

    Everybody knows that Magento is a little bit slower. Tuning up Magento website without help from a developer or hosting provider is like a non-professional activity. I also had the same problem and decided to hire good developer here .You know result is great!

  • Thanks for share about Magento Speed Optimization Techniques for Accelerating Your Website’s. Your content is really useful. Recently i came across another blog post which i was found in Google. They have mentioned more details about magento speed optimization. Check the link here. http://www.sitepronews.com/2015/09/03/magento-speed-optimization-techniques-for-accelerating-your-websites/

  • Thanks for share about Magento Speed Optimization Techniques for Accelerating Your Website’s. Your content is really useful. Recently i came across another blog post which i was found in Google. They have mentioned more details about magento speed optimization. Check the link here. http://www.sitepronews.com/2015/09/03/magento-speed-optimization-techniques-for-accelerating-your-websites/

  • vipul baldaniya

    Thank you for this information. It is very interesting.

  • Hi Subrata,
    i begin with magento but i have large experience
    with php n other things but i feel fear why is so slow to work
    for me all things are new to self knowledge 😀
    so if u like see my store (i say that begining at magento haha)
    is Ragazze i buy an template
    so all are more hard (i guess it)
    equals thank u for this article that help any user around of world 🙂

    cheers

  • Parvinder Singh

    Hello Subrata

    I need your help our site is herbalroots.com page size of home page is 2.3 mb and request is 110 but response time is 9 seconds please suggest me what I do

    • Arijit De

      Hi Parvinder,

      One thing you can do is check the Log CleanUp configuration in Magento Configuration section and make it enable for daily. Secondly, compilation makes the processes faster as it caches the files and execute from there. So, you can enable the compilation process.

    • Biplab Rout

      Hi,
      You should always check for the latest patch updates that will be notified to you. It usually contains all bug fixes and performance improvement. Secondly you should always enable your build in caching module. By navigating : “System” → “Cache Management.” , select all and click on enable and then submit.

  • TrungNguyen

    Thank you for your post!
    There is also a very useful extension to increase Magento website speed effectively called Defer Javascript extension
    by deferring JavaScript files loading after all HTML and CSS files loading so that a web page will render HTML and CSS in advance.
    – Automatically defer parsing of JavaScript till the last moment after all HTML and CSS loading
    – Reduce loading time and speed up Magento sites

Transform Your Business

APPSeCONNECT can help you accelerate your path to success by seamlessly integrating your applications

Get a 30-Day FREE Trial

x x