VHjD76rJPFUdrLp9aMufj6CAZXIPFT
Magento

Magento 2 Performance Optimization: 12 Proven Best Practices to Render

4 min read By: Zenul Jinwala

13 August, 2021

Magento 2 Performance Optimization_ 12 Proven Best

If you own a Magento 2 eCommerce store, then Magento 2 performance optimization is imperative for you to stay ahead of the curve. The main motive of any eCommerce business is to render excellent customer experience to lead to successful conversion and even revisiting customers. And, superior customer experience starts with a fast online shopping store. The one that doesn’t keep your customers waiting.

Slow speed can hurt your business and affect your revenue. A slow Magento store can impact the sales metrics adversely and even harm your conversions. According to a study, even a 0.1-second delay can harm 7% of the conversions. And this is something no business can afford, slow Magento 2 store, poor performance, unhappy customers, and bad quarterly statements.

Slow load times of a Magento 2 website can be due to a sudden spike in HTTPS requests, failure in deploying a Cache system or a content delivery network, heavily weighted website pages, or server latency. Other reasons can be identified only after a thorough introspection of the Magento 2 eCommerce store.

There are ways to dramatically optimize your Magento 2 online store with a few Magento 2 speed optimizations. Let’s dig in.

1. Full Page Caching for Magento 2 Performance Optimization

Caching facilitates super fast speed. Your eCommerce store would load much faster when there is less load on the server. It is analogous to the human body feeling light and energetic while your mind is at ease; the same logic works with less server load.

Full-page caching works wonders when it comes to Magento 2 optimization. The thumb rule is to keep the server as light as possible. Follow these steps:

System > Cache Management > Select all > Enable > Submit

2. Choose the Magento Host Wisely

Although obvious, hosting does lay the foundation for your Magento 2 store. You can have everything ideally in place, but your online store can still go sluggish if you are with the wrong host.

You can never expect your eCommerce store to perform optimally on a not-so-good VPS. Hence, a fast and reliable web host is a must to improve your Magento 2 performance.

Your web host must provide you with high-security standards, a high-speed connection, and finally, 24*7 Magento Support Services. Usually, a quality Magento hosting provider also helps in Magento 2 performance optimization.

3. Production Mode

This one is hard to skip. Magento 2 performance optimization is incomplete without selecting the production mode. It is specially crafted for the Magento 2 platform.

There are three running modes in Magento 2, default, developer, and Production. Running the store on default or developer mode wouldn’t make much of a difference.

Hence, to speed up Magento 2, make sure to run your online store on Production mode. It is deemed to be the fastest. To enable Production mode on your Magento web store:

Php bin/Magento deploy:mode:set production 

4. Enable Flat Categories and Products

Magento leverages the EAV model – entity attribute value, to store products and customer data. And one of the aspects of having great speed in Magento 2 is the ability of database loading. You can speed database loading in the configuration by enabling Flat Catalog. It allows you to offload the number of databases when there is a request for displaying the product. Simultaneously, the MySQL query complexity will be reduced.

Once you enable the Flat Catalog, it merges the data into one database. Also, the performance is improved by responding to MySQL queries faster. Finally, enabling the Flat Catalog is beneficial for eCommerce online stores having more than a thousand products.

To enable Flat Catalog:

  1. Stores > Configuration > Catalog
  2. Storefront > Use Flat Category > Yes
  3. Save Config

Make sure to clear the cache after enabling the Flat Catalog.

5. Merge CSS and JS Files

There is an option in Magento 2 to merge, minify and bundle. If you make the best use of it, you will end up with enhanced Magento 2 store performance and more incredible speed. You can merge and minify CSS and JavaScript files to make the webpage as light as possible. This will eventually speed up your Magento 2 store.

Here is how you can use it for Magento 2 Performance Optimization

a. Merge and Minify CSS

i. Open Backend

ii. Stores > Configuration > Advanced > Developer > CSS Settings

iii. Set “Yes” for Merge CSS Files and Minify CSS Files

b. Merge and Minify JS

i. Open Backend

ii. Stores > Configuration > Advanced > Developer > JavaScript Settings

iii. Set “Yes” for Merge JavaScript Files and Minify JavaScript Files

6. Clean Magento Logs and Database

Magento 2 keeps data logs for up to 180 days. This can make your database sluggish and heavy. You should change the settings to the lowest possible value, 14 days, and click on “Save Config.”

To manually clean up the database, you have to follow the following steps.

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

7. Image Optimization

Images account for about 50 to 60 percent of any web page’s total weight. Hence, it is imperative to optimize images to speed up Magento. Optimizing images can dramatically increase the speed of your web pages. You can either compress the images before uploading using PhotoShop or other optimizing tools. Or, you can choose from Magento 2 speed extensions, Compressor Extension and TinyPNG Extension.

8. Audit the Third-Party Plugins for Magento 2 Performance Optimization

This will significantly enhance your Magento store’s performance. Custom extensions are known to make Magento 2 heavy. It can be easily said that the number of third-party plugins are inversely proportional to the speed of your Magento website. Therefore, auditing your third-party extensions can render some breathing space for your Magento 2 eCommerce store.

Custom extensions often do more harm than good to your eCommerce websites, as many of these are created by amateur coders and are not at par with the Magento 2 code that world-class professionals write. The obvious choice is to lean towards the code that has come straight from the experts. This will work for sure to speed up your Magento 2 store. Here is how to do it:

  1. One by one, disable all custom extensions.
  2. Benchmark the speed first with and then without an extension.
  3. Shortlist the extensions that consume the most amount of time to run.
  4. Contact their vendors to patch.
  5. In case of no patch, remove the extension and find a better substitute.

9. TTFB Optimization

TTFB, Time To First Byte, is the actual time taken by the browser’s request to travel to the server and receive the server’s response to it (Latency). This is why the TTFB is also known as Server Response Time. Also, it is the time when the server generates the HTML.

According to Google, your TTFB should not be greater than 200ms. It actually should be relatively less than that to perform optimally. Or else, it is considered a lousy TTFB. Hence, the Server Response Time Audit is quintessential to speed up your Magento 2 store and rank better on Google.

10. Code Optimization

A complex code will for sure add to the weight of your Magento making your website slow. Hence, code optimization becomes necessary while having your eCommerce store on a complex platform like Magento 2. To explain in a bit of detail, we have taken this in segments:

a. PHP Accelerators for Magento 2 Performance Optimization

To perform code optimization for heavy PHP coding, you can conveniently use PHP accelerators. These accelerators cache the PHP scripts in the webpage and improve your store’s speed.

b. Reduce Third-Party JavaScripts

Audit all the third-party JS files in your Magento 2 web store cautiously. Also, be careful while using random third-party JS codes with your Magento 2 store and run a speed test before implementation.

c. Limit/Disable PHP Modules

Many PHP modules do not contribute anything to your website speed. Instead, make your Magento 2 slower. Hence, uninstall unwanted PHP modules from your coding section and clean up your space to enhance the speed.

d. Do not Abuse jquery.ready

Sometimes during Magento 2 development, CPU-intensive tasks are put in jquery(document).ready, this eventually slows down the web page loading speed. Therefore, to avoid any lag, you must choose onLoad events very carefully.

11. Cut Back on Extensions and Modules for Magento 2 Performance Optimization

More extensions lead to more HTTP requests, CSS, and JS files. This will eventually increase the web page load time. Hence, the mantra is to keep your Magento 2 with as few extensions and modules as possible. You can disable the modules by following these simple steps.

  1. Stores > Configuration > Advanced > Advanced
  2. “Disable” the modules you do not need > Save Config

12. Content Delivery Network

You can decrease the load time drastically by leveraging the Content Delivery Network, CDN. It is an extensive distributed system of servers to store web content and related files closer to the user requesting them.

The closer the CDN to a user, the faster the content will be delivered to them. It will ensure that your product images, CSS, and JS load faster for your users. It is also helpful in offloading part of the server’s stress, leading to fewer processes required for each customer. It also reduces bandwidth costs and improves response times.

Magento 2 Performance Optimization and Core Web Vitals

With the announcement of the upcoming algorithm on ranking factor by Google with measurement and page experience, the eCommerce store owners are guided with three important metrics, LCP, FID, and CLS, essential to deliver an excellent user experience.

1. Largest Contentful Paint, LCP for Loading

LCP measures the total time taken to display the main content element of the web page to the user. This is useful in checking the page rendering time and loading performance.

2. First Input Delay, FID for Interactivity 

FID keeps a check on how swiftly a web page responds to user interaction like clicking, tapping, or hovering.

3. Cumulative Layout Shift, CLS for Visual Stability 

CLS scores the unexpected web page layout shifts like the movement of text, link, or buttons during the loading phase.

Magento 2 speed optimization helps optimize your eCommerce store content and supports the upcoming 2021 Google algorithm UX changes with the Core Web Vitals.

Conclusion

Speeding up your Magento 2 eCommerce store is not rocket science. Instead, it is imperative for business owners to boost sales and eventually lead to growing revenues. You will surely improve your Magento 2 store’s overall performance by practicing these tips and tricks, including the speed.

If you do not have the resources to optimize your Magento 2, talk to our experts, and we will analyze, optimize and manage your Magento 2 store to the best of our expertise.

eCommerceMagento 2magento 2 performance optimizationmagento performance optimizationMagento Performance optimization solutions
Zenul Jinwala

As Director - Marketing, Zenul leads the marketing and branding at Krish. He brings with him an in-depth understanding of the evolving digital ecosystem and has a proven expertise and experience in strategic planning, market and competition analysis, creating and implementing client-centered, lead-gen and brand marketing campaigns. He has a heart for technology innovation and has been a keynote speaker on various platforms.

Trusted by leading brands

Ready to redefine digital experience?

Be it the Americas, EMEA, or APAC - our regional experts are available to offer solutions tailored to your needs.
Let's Get Started


  • By submitting this form you agree with the terms and privacy policy of Krish

    Meet us at the !

    • By clicking “Submit”, you consent to allow us to send you communications.

      Talk to us!


      • By submitting this form you agree with the terms and privacy policy of Krish

        Schedule A Meeting


          • Schedule Date

          • 2 November3 November


        • By submitting this form you agree with the terms and privacy policy of Krish

          Schedule a Call


          • By submitting this form you agree with the terms and privacy policy of Krish

            Schedule a Call


            • By submitting this form you agree with the terms and privacy policy of Krish

              Schedule a Call


              • By submitting this form you agree with the terms and privacy policy of Krish

                Schedule a Call


                • By submitting this form you agree with the terms and privacy policy of Krish

                  Schedule a Call


                  • By submitting this form you agree with the terms and privacy policy of Krish

                    Schedule a Call


                    • By submitting this form you agree with the terms and privacy policy of Krish

                      Schedule a 30 Mins No-Obligation Consulting Session


                      • By submitting this form you agree with the terms and privacy policy of Krish

                        Schedule a 30 Mins No-Obligation Consulting Session


                        • By submitting this form you agree with the terms and privacy policy of Krish

                          Schedule a 30 Mins No-Obligation Consulting Session


                          • By submitting this form you agree with the terms and privacy policy of Krish

                            Schedule a 30 Mins No-Obligation Consulting Session


                            • By submitting this form you agree with the terms and privacy policy of Krish

                              Schedule a 30 Mins No-Obligation Consulting Session


                              • By submitting this form you agree with the terms and privacy policy of Krish

                                Schedule a 30 Mins No-Obligation Consulting Session


                                • By submitting this form you agree with the terms and privacy policy of Krish

                                  Schedule a 30 Mins No-Obligation Consulting Session


                                  • By submitting this form you agree with the terms and privacy policy of Krish

                                    Schedule a 30 Mins No-Obligation Consulting Session


                                    • By submitting this form you agree with the terms and privacy policy of Krish

                                      Let's Get Started


                                      • By submitting this form you agree with the terms and privacy policy of Krish.

                                        Schedule A Demo

                                          • Select Accelerator Type

                                          • B2BB2CMarketplace


                                        • By clicking “Submit”, you consent to allow us to send you communications.

                                            Download Corporate Profile

                                            Please fill out the form below to download.

                                            • By submitting this form you agree with the terms and privacy policy of Krish.

                                            Let's Talk


                                            • By clicking “Submit”, you consent to allow us to send you communications.

                                              Let's Talk


                                              • By clicking “Submit”, you consent to allow us to send you communications.

                                                Adobe Commerce Feature List

                                                  Please fill out the form below to download the feature list.


                                                  By submitting this form you agree with the terms and privacy policy of Krish.

                                                • Let's Talk Growth



                                                  • By submitting this form you agree with the terms and privacy policy of Krish

                                                    commercetools Feature List

                                                      Please fill out the form below to download the feature list.


                                                      By submitting this form you agree with the terms and privacy policy of Krish.

                                                    • Let's Talk Growth!


                                                      • By submitting this form you agree with the terms and privacy policy of Krish

                                                        Claim Your Audit Now!


                                                        • By submitting this form you agree with the terms and privacy policy of Krish

                                                          Claim Your Audit Now!


                                                          • By submitting this form you agree with the terms and privacy policy of Krish.

                                                            Let's Get Started

                                                            • By submitting this form you agree with the terms and privacy policy of Krish.

                                                              Unlock the Full Potential of Magento.
                                                              Talk to our eCommerce expert today!


                                                              • By submitting this form you agree with the terms and privacy policy of Krish.

                                                                Migrate to Magento to Experience Limitless Commerce. Talk to Our eCommerce Experts Today!


                                                                • By submitting this form you agree with the terms and privacy policy of Krish.

                                                                  Get Certified Magento Experts for Your Adobe Commerce Support Needs. Talk to Our eCommerce Experts Today!


                                                                  • By submitting this form you agree with the terms and privacy policy of Krish.

                                                                    Scale High with Award-winning Adobe Commerce Gold Solution Partner Agency. Talk to Our eCommerce Experts Today!


                                                                    • By submitting this form you agree with the terms and privacy policy of Krish.

                                                                      Scale High with Award-winning Magento Solution Partner Agency. Talk to Our eCommerce Experts Today!


                                                                      • By submitting this form you agree with the terms and privacy policy of Krish.