A Complete Guide to Optimize Magento 2 Store Speed

Magento 2 Store Speed

If I ask what are the most crucial factors when it comes to ranking in the search engine, you might give me a list of important elements mainly:

  • A secured website
  • Optimized content
  • Mobile-friendliness
  • User interaction, etc.

But there is one factor that should most focus on : the speed of your website.

It is an important metric to determine your site’s SERP position and deliver a great user experience.

And I bet if you have a Magento powered website, you are right now probably nodding in agreement. With 1.4% market share of all websites, Magento is no doubt one of the most popular eCommerce platforms globally. This is because it is easier to use, is customizable, and offers better security features. However, it does have few flaws like every other platform- page speed being the prominent one.

So, if you have faced speed issues or are dealing with it currently then you have come to the right place. This blog brings the best practices to increase Magento 2 store load time.

But first, let’s find out why the speed of Magento 2 gets slower.

Magento 2 by default runs smoothly. The problem occurs because of lack of knowledge in optimizing the website. Apart from that, not using appropriate extensions and plugins will also influence store speed.

So, to help you out, we have prepared a complete guide to increase Magento 2 Store Speed:

Update to the Latest Version

Magento releases new updates regularly. A simple tip to increase store load speed is to update your Magento store to the latest versions. So, if you are still using Magento 1, I recommend switching to Magento 2 ASAP.

Choose the Right Magento Hosting

Hosting plays a major role in site performance optimization. Choosing the right hosting plan will result in a quick server response. Consider hosting your store on a platform that ensures a smooth user experience, high security, and fast performance.

Tip: Instead of shared opting, using VPS (Virtual Private Server) or Cloud-based hosting is a good choice. It gives you total control of the server, lets you scale resources, and save costs.

Optimize Java Code and CSS

If your website is on Java-script, jquery.ready will load the functions first and then provide the user with meaningful content. Because of this, your user has to keep waiting till he gets what he wants and that disrupts user-experience.

You can avoid this by using $(window).ready() and $(window).load() instead of non-critical JS code. Another way to increase speed is by using intervals and timeouts. For example, if there is a heavy JavaScript code then you can divide it into small parts and with minimal intervals.

Image Optimization

Every eCommerce website will include several high definition images. Sometimes, heavy size images can slow down the speed of your website. The solution here is

(a) compress all images

(b) use image format like JPEG XR, JPEG 2000, Webp.

This will significantly improve store speed.

Remove Unnecessary Database Logs

Unwanted database logs keep gathering on the store if you have been running a website for a long time and did not clear the database. This affects your store speed and overall performance. Clearing cluttered database logs will help you improve speed. Magento 1 has a direct option of clearing databases. But if you are using Magento 2, you will have to manually clear the logs.

For cleaning up the database-

  • In phpMyAdmin, select all of the log_% tables and select “Empty” from the drop-down.
  • Select “Yes” when it asks to TRUNCATE the tables.

Third-Party Extensions

If you have too many third-party extensions installed or they are poorly coded, your website will take time to load the content. You can solve this issue by inspecting all plugins and eliminating them. Perform extensions audit and see if the speed of the site changes. Test all the CMS pages like homepage, category pages, product pages, checkout pages. By disabling a Magento module if the store becomes faster, you have found the abuser. Contact the extension provider immediately and inform them about the problem faced.

Opt for Cacheable Blocks

You can optimize store speed by adding cacheable blocks in Magento 2. It is possible to fix the cache problem by identifying incorrect cacheable blocks. For this, you need to access layout files which you will find in the below-mentioned folders.

  • app/design/frontend/[Package]/[Theme]/[Module]/layout/*
  • app/code/[Company]/[Module]/view/frontend/layout/*
  • vendor/[company]/[module]/view/frontend/layout/*

Select Production Mode

Magento 2 has three running modes: default, developer, and production. Production mode is specially crafted for Magento 2 and improves store performance. It is the fastest mode of all three. So, to increase store speed consider running your store in production mode. You can do this by using the command: php bin/magento deploy:mode:set production

Configure Redis Cache

Redis is an open-source data structure store. You can use it as a cache, database, and message broker. By configuring the Redis cache in Magento 2, you will be able to enhance website scalability and optimize store speed. You can either do this manually or by using the command line.

Enable Flat Catalog

In Magento2, you can store all your data and products through the entity attribute model. As the number of attribute models increase, the store speed and user-experience reduce. Consider enabling a flat catalog attribute model so that you can store all the data in one place.

To enable the flat catalog, follow these steps:

  • Go to stores> settings >configuration section in the admin panel
  • Under the catalog section, select catalog on the left panel
  • Open the storefront section
  • Click on “Yes” and use flat catalog product fields
  • Click on Save configuration button

Implement Varnish Cache Tool

Varnish is a caching tool that creates a layer between the web server and users. It caches the files that users request into RAM. So, enabling the varnish cache tool will bring up all request files in a go. This will significantly reduce page load speed.


Store load time plays a major role in the smooth functioning of an eCommerce website. I hope these practical techniques help you to optimize Magento 2 store speed to get good traffic on your website.

Leave a Comment

Scroll to Top