Speed up Magento 2 store
October 6, 2018 Sanjay Dabhoya

Jim wanted to buy some groceries online and he was surfing for the best deal. He signed up to a local website and started looking for products he wanted to order. As the website was slow to load, he searched for another grocery shopping website and could place an order within a few minutes.

low speed issue

If you own an eCommerce store, it is important to check the speed of the site. It matters a lot as no one would like to make a purchase from a website that is slow to load. You could be losing a lot of business with a sluggish website as nobody wants to waste time in today’s busy world. Think about it!

A fast loading website can have a positive impact on your search rankings too.

Magento 2 is a popular eCommerce platform that is used by many web owners to create user-friendly web stores. Website owners should optimize their Magento 2 store to ensure success.

Let’s dive in!

11 Proven tips to speed up Magento 2 website


1. Check all The Third Party Extensions

Before you start working on optimizing Magento 2 website speed, you should check all the third-party extensions that have been installed on your website.

Several Magento 2 extensions are available for free, while some others are paid. Some Magento 2 extensions may not be developed for optimization and when installed, they may slow down your website.

It is important to check the speed of Magento 2 website whenever you install any third-party extension. It can be a good idea to turn off the extension and check the speed.

If you feel that the website is faster after turning it off, then you can get in touch with the extension provider and discuss the same. You can ask the providers to replace it or fix the issue.


2. Server Requirement and Configuration

The server is a key factor that determines the performance of a website. If the server does not function properly, you cannot have a fast loading website.

Investing in a good hosting provider becomes crucial when you have an eCommerce website so avoid choosing free or shared hosting. If you do not have a problem with the budget, you can opt for a dedicated server or VPN.

Magento 2.2.x technology stack requirements:

  • Operating system (Linux x86-64)
  • Memory requirement: Up to 2GB of RAM
  • Composer (latest stable version)
  • Web servers: Apache 2.2 or 2.4, nginx 1.x
  • Database: MySQL 5.6, 5.7
  • PHP: 7.0.13–7.0.x, 7.1.x

Source: https://devdocs.magento.com/


3. Content Delivery Network

CDN is a system of distributed network services that provide web content to the users according to the geographic locations. It also helps visitors load web pages faster.

To set up CDN, please go to:

    Stores -> Configuration -> General -> Web -> Base URLs (Secure)

After that, you can insert your HTTPS URLs to speed up your website.

Content Delivery Network

Image source: orpical.com


4. Optimize The Images

eCommerce websites have a lot of images and banners for attracting the attention of the target users and display the products. Images can affect the website’s performance. It is important to use compressed images for less data usage and faster page loading.

For product images, you should use JPEG format. Logos on the website can be used in PNG or SVG format.


5. Enable Flat Catalog

One of the major problems with Magento is the read speed of the database. If your Magento 2 website has a lot of products, then you may face the problem of a slow loading website.

You can enable flat categories and products to increase the read speed of your database. It helps to reduce MySQL query complexity and improves the performance of your website.

How to enable flat options?

    Go to Stores -> “Configuration” in “Settings” Section -> “Catalog” in “General” Tab -> Section “Storefront” -> Fields “Use Flat Catalog Category” and “Use Flat Catalog Product” change to “Yes”


6. MySQL Configuration Optimization

These are some little tips to optimize via MySQL configuration.

MySQL has its own “query cache” that it uses in Magento to help generate dynamic pages and content while improving performance. These are some recommended settings for your my.cnf file.

You can try this:

  • query_cache_type = 1
  • query_cache_size = 32M
  • query_cache_limit= 2M

At last, This is a suggested setting for php.ini.

  • php_value memory_limit 128M

Useful Reading: Magento Security Issues & Fixes For Ecommerce Stores (7 Things To Consider)


7. Utilize Caching

Magento comes with a built-in caching module. Make sure all Cache Types are enabled by navigating to “System”“Cache Management”.

Utilize Caching


8. Change To The Production Mode

You should run Magento in production mode once it is deployed to a production server. Production mode provides the highest performance in Magento 2.

  • php bin/magento deploy:mode:set production

The most important aspect of this mode is that errors are logged to the file system and are never displayed to the user.

In this mode, static view files are not created on the fly when they are requested; instead, they have to be deployed to the pub/static directory using the command-line tool. The generated pages will contain direct links to the deployed page resources.


9. Enable JS & CSS optimization

CSS and JS files help your frontend look better. However, they are one of the core factors that slow down your site speed. Luckily you can minimize the influence in Magento 2 by enabling JS & CSS optimization

To enable JS & CSS optimization:

    Go to “Stores” -> “Configuration”. In “Advanced” Tab -> “Developer” and in that click on the “JavaScript Settings” (Fields “Enable Javascript Bundling”, “Merge JavaScript Files”, “Minify JavaScript Files” change to “Yes”)

JavaScript Settings

And on the same page, click on “CSS Settings” (Fields “Merge CSS Files“, “Minify CSS Files“ change to “Yes”)

CSS Settings


10. Clean the Log Files

While optimizing the Magento database, you can also check your Magento project’s var/log directory. Sometimes it has around 200MB size so it is time for cleaning.

Please take a backup first of that directory in case of rollback.

After it, please go to your Magento project’s var/log directory and run below command,

    rm -rf *

NOTE: Make sure that when you run the below command, you must double-check that you are in your Magento project’s var/log directory.


11. Magento Updates

Magento team constantly works on improvements in performance. You should not miss out any updates and ensure that your eCommerce store is upgraded as per the latest version of Magento 2. You can look for an expert Magento web development company to help you update your website.


Wrap Up

There can be several reasons why your Magento website is slow. It is important to identify the reasons and check all the factors to ensure the high speed of your eCommerce website. If you do not know how to check the above-mentioned points for your website, you can look for expert Magento developers to help you. Hire the best Magento 2 web development company to make your website fast loading.

Also Read: What Are The Latest Magento Development Trends?

Categories : Magento Web Development, Web Development

Related Posts

Mayur Dhudasia

Mayur Dhudasia is a technologist, leader and the head of Magento development team. He has more passion than his experience. He has a happy smile in his face always!

Read more posts by Mayur Dhudasia

Really enjoyed this post?

Be sure to subscribe to the Solwin Infotech newsletter and get regular updates about awesome article posts just like this and much more!

Comments  (12)

  1. satyam priyadarshi says:

    Thanks for sharing this useful post !! This is really a informative post For all web developers.

    1. Post AuthorMayur Dhudasia says:

      You’re welcome, Satyam! Glad you found it helpful.

  2. Ahmed says:

    Very Useful Idea For Web Developers and Designer.
    Thanks For This Posting.

    1. Post AuthorMayur Dhudasia says:

      Hey Ahmed, Glad you found it helpful. Thanks.

  3. Syed Muneeb Ul Hasan says:

    Hello Mayur ,

    Thanks for sharing these tips for boosting the speed of Magento 2 store. And I would like to add few more tips:

    1. Try to Use Light-Weight Theme so that it will not affect the store’s speed much.
    2. As Magento is the powerful e-commerce platform so your store has to be hosted on a reliable and fastest hosting.

    1. Post AuthorMayur Dhudasia says:

      Happy to see you here, Syed. Your advice is helpful for our blog readers. Thanks.

  4. Mahalia Chalaban says:

    Hi there, just wanted to tell you, I liked this blog post. It was helpful. Keep on posting!

    1. Post AuthorMayur Dhudasia says:

      We will do it for sure, Mahalia. Keep reading.

  5. Madeline says:

    This is really interesting, You are a very skilled blogger.
    I’ve joined your feed and look forward to seeking more of your wonderful post.
    Also, I have shared your website in my social networks!

    1. Post AuthorMayur Dhudasia says:

      Thanks for your support, Madeline. Happy to help.

  6. Elmer Wakley says:

    Hi there! I could have sworn I’ve been to this site before but after reading through some of the posts I realized it’s new to me. Anyways, I’m definitely glad I found it and I’ll be book-marking and checking back frequently!

    1. Post AuthorMayur Dhudasia says:

      Thank you so much for your kind words, Elmer. Happy to see you here.

Speak your mind

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

Note : Please do not spam, no link dropping, no keywords or domains as names; and do not advertise!

30% off