How To Get Product Collection By Product Id In Magento 2? 11 Tips To Speed Up Your Magento eCommerce Site

Did you experience it... The sudden drop in sales with an increase in page load speed of your Magento eCommerce site.

Doesn’t matter which platform your website is built-on, the site speed will be a concerning topic. In simple words, the page load time is the undermining factor that decides the traffic on your site. A site's speed ultimately affects its bounce rate. That’s why your site must load faster to make it comfortable for site visitors.

Google considers page speed as one of the essential ranking factors on SERP. To outrank others on search engines you must have a website that converts and has a fast loading speed.

According to research, the top 10 ranking pages on search results have well-optimized and fast-loading sites.

While many are facing difficulty to achieve a fast-performing website but to rank higher on google your site should load within 3 seconds. With a site speed of two seconds, the odds of doubling your traffic and revenue increase drastically.

Knowing the important factors behind your low page speed will be the first step to getting a score of 100% in the page speed insights tool. There can be any underlying issue to your site enabling it to load slowly. It can be due to large images, hosting platforms, using old versions, large JS or CSS files, or any other. To check, add your URL in google page speed insights and click analysis to run a quick test. It will show you a report about your website and what is retarding its performance.

Which eCommerce site builder should be most suitable for you?

With a lot of options available on the internet and more coming every day, you are most likely to be in a confusion about choosing a suitable eCommerce application. When it comes to eCommerce CMS or platforms a variety of options are available. You can go with Shopify, WooCommerce, Prestashop, and many others to choose from. Besides that, Magento 2 is one of the most favored eCommerce builder platforms for online businesses. This is because it is a robust platform that provides advanced functionalities and customization options. Magento offers higher scalability so don’t have to shift to another platform later on.

There are many parameters to look upon for Magento 2 speed optimization. Not necessary to focus on all parameters. Only by optimizing the most affecting ones will leverage your Magento 2 speed.

Let’s get you started, with the ten effective tips suggested below:

    • Upgrade To Latest Version
    • Image Optimization
    • Integrate CDN
    • Utilize Caching
    • Merging JS AND CSS
    • Magento 2 Defer Parsing of JavaScript
    • Reduce Server Response Time
    • Less Extension & Modules
    • Turn Production Mode On
    • PHP Accelerators
    • Select Fast Web Hosting

Let’s take a closer glimpse at all of them!

Upgrade To Latest Version

New updates often come with bug fixes and performance improvements. Magento 2 often notifies users regarding any new or critical updates to the store. It’s better to update it rather than ignoring them. With the latest version, you’ll get better security patches and a boost in performance. Upgrading to the latest version of Magento 2 requires a little bit of work and some technical knowledge. Check out this tutorial on upgrading to the new version in Magento 2.

3 main steps involved in Magento 2 installation:

      • In the Magento file tree add a new version
      • Run the installer to upgrade the database
      • Switch all themes and custom extensions to a newer version

Image Optimization

Large images do have a critical impact on the speed factor. Stats say that 60% of the website comprises images. This calls for the need for image optimization to speed up your Magento site. Thus, by optimizing the product images will have a significant impact on the Magento site loading speed. You can optimize them in two ways - First, by using photo editing tools like Photoshop to compress the image files. Secondly, there are speed optimization extensions available on the internet.

Some of the best image optimization extensions are given below:

      • GTspeed ( From GTmetrix)
      • Compressor Extension
      • Image Optimizer ( From Magento)

Integrate CDN

Ecommerce store owners involve various kinds of content types that need to be delivered faster to your visitors. The simplest way to achieve a speed mark in a Magento store is to integrate a content delivery network. The CDN usually reduces load time by serving the elements ( such as product descriptions, and images) from different locations around the globe. This will help in delivering them much faster to the shoppers.

KeyCDN offers the simplest integration with both HTTP and HTTPS configuration to the Magento store.

Make Use Of Cache

Reduce your page requests on the database by enabling website cache. Magento 2 offers many forms of caching mechanisms to improve the speed of the website. Moreover, Magento itself provides a built-in caching module in combination with 3rd party modules. People have got great website performance by integrating NGINX + APC + Memcache + Varnish caching together.

Here is a quick synopsis of varnish caching

It is an open-source web application accelerator/HTTP accelerator/ caching HTTP server Magento 2 defer parsing of javascript extensions proxy. The concept is that files or their fragments are cached by a varnish in the memory to reduce network bandwidth and response time for future similar requests.

The varnish is designed exclusively for the HTTP protocol, unlike other popular web servers.The varnish is designed exclusively for the HTTP protocol, unlike other popular web servers.

We will discuss more on this later.

Ensure that all cache types are enabled by navigating to “System” > “Cache Management”.

Other forms of cache to optimize your Magento store.

Browser Caching:

With browser caching you add coding snippets to your .htaccess files Make sure not to malfunction the store.

GZIP Compression:

It helps in compressing the store web pages and style sheets before sending it to the browser, at the server level.

Page Caching:

With the page caching mechanism you are likely to speed up your Magento store. It serves already visited pages to the shoppers from the cache, thus, turning off server load.

Merging JS AND CSS Files

Your site comprises many javascript and CSS files. Therefore, merging them into a single file will improve its performance on the web. This also reduces HTTP requests. Magento 2 provides a built-in feature to merge CSS and javascript into one file. Follow the below steps to merge two files,

1. Go to stores >> configuration.


2. After that, click “advanced” and then “developer”


3. Finally, change javascript and CSS settings to “yes” and then “save config”.


You need to clean the cache to get the changes done. That you can do manually by running the below commands or by using Magento extensions.

      php bin/magento cache:clean php bin/magento cache:flush

This also enables you to minify JS/CSS scripts for faster browser loading.

Magento 2 Defer Parsing of JavaScript

Parsing the javascript is one of the best techniques to increase website speed. Magento 2 defer parsing of javascript extensions developed by Magespark will help in reducing the load time of webshops. With javascript parsing, you will be generating more sales for your web store sooner or later. As we all know javascript is the leading reason behind the reduction in google pagespeed and drop in the value of a webpage. It’s because Javascript begins to load much earlier than HTML.So to end it, parsing of javascript is as crucial as other tactics.

Our Magento 2 extension empowers you to reverse the loading process by setting up javascript parsing in your store.

Reduce Server Response Time

Magento 2 built-in cache feature is pretty enough to get your site response’s time to approx. 0.5s. But Google doesn’t settle with this, it is avid. That’s why Magento 2 has the feature to support a full-page cache with varnish. Follow the steps below to set up varnish.

In backend, navigate to Stores > Configuration > Advanced > System > Full Page Cache

This transmute caching application to varnish


Perform the settings below in varnish configuration and that’s it.


Less Extension & Modules

More extensions and modules will likely increase the load on your website. This will ultimately result in multiple HTTP requests from the server. That’s why it is recommended to make use of fewer extensions on Magento and get rid of the useless ones. Undoubtedly, this will help your site in gaining top-speed performance. You can do this by disabling unused modules.

Turn Production Mode On

Magento site performance also depends on which mode you run it. It operates in three modes: default, developer, and production mode. The default and developer are for debugging purposes while production is for the live site. If you haven’t switched your store to this production mode then do it fast to give your customer a better user experience. This is because in terms of security and caching production mode is way better. It utilizes full page caching alongside a fully built pub folder to pull from, thus resulting in smooth and seamless functioning of the store.

PHP Accelerators

Another form of caching technique is PHP accelerators. This is also helpful in reducing page load time. Its function is to enhance the performance of PHP scripts. Unarguably, it will spike your site speed as it caches the scripts in a compiled state. Have a look at some of the popular PHP accelerators here:

      • Xcache
      • APC
      • ZendOptimizer+

Select Fast Web Hosting

At last, must ensure to have a reliable and fast web hosting provider rather than a cheap shared web hosting. It is an important decision to make to improve your site performance. The problem with shared hosting providers is that their servers have resources shared between hundreds of users. We recommend opting for managed web hosting or VPS like digital ocean, Linode, or any other. Here you have complete control over your resources. If you aren't tech-savvy, then getting your website on cloud platforms is indeed the best solution to get started.


No doubt, you did a good job of making a great website by adding quality images, content, and icons to make it top-notch. But all of these will finally end in a website slower than the standards set by Google. Speed has a much more important role to play when it comes to driving site conversions.

The thing is, people are in a hurry while searching on the net. They barely have any patience to wait for 10 seconds for your site to load. This may increase the bounce rate. Google sees this as a bad user experience and throws it back in SERPs.

We first start by paying attention to the issues that are harming your site performance. As discussed, there is more than one way to boost the speed of your Magento 2 site. From caching to CDN, image optimization, js and CSS merging, and many other things. Besides all, you must start with great web hosting. By focusing more on trendy features you are going to lack quality.

Did we miss some of the optimization tips that should be there in the list? Then we’d be glad to know them in the comments below.