How to speed up your Magento 2 website?

Speed-up optimization is a crucial step when you want to increase traffic to your Magento website. A slow-loading website will have a high bounce rate, which is one of the most valuable metrics used by Google to decide your ranking in search engines. So don’t lose potential shoppers because of slow websites.  In this post today, we will show you helpful information about speeding up Magento 2.

Why Magento 2 is slow?

Why Magento 2 is slow?

The Magento 2 speed is not slow by default as the default store is powerful and runs smoothly. In fact, most slow interface and high loading times problems are because by misconduct as well as lack of knowledge in optimizing the site. Besides, when you can not meet the basic requirements to run a store on Magento such as using inappropriate extensions, or do not enable the right modules, your website’s speed will definitely slow down. Besides, if you do not do something to fix these issues, your website may lose a great number of potential customers due to the slow speed. So, if you don’t want to lose traffic and sales, get ready to check your website and speed up accordingly. The fact that your Magento site is no longer as fast as it was may be due to the below reasons:

  • Not meet the system requirements to run the Magento store
  • Use slow and inadequate hardware
  • Use inappropriate extensions
  • Not enable the right plugins
  • Not optimize MySQL, NGINX, and PHP configuration
  • Make inappropriate customization
  • Disable Magento caching

How to Measure Magento Speed

Testing site speed is the crucial step to evaluate how serious and where the issues are. Your team should perform speed tests regularly in a maintenance cycle to optimize and speed up Magento. Therefore, we recommend some helpful tools for basic measurement of your site:

How to speed up Magento 2 Website?

speed up Magento 2 Website

1. Use Lightweight Magento Themes

The website theme can also significantly slow down your website, especially if it comes with a lot of widgets, sliders, and custom blocks. Just imagine how much time it will take to load all of them. So, it is bad in every sense for website users with good internet connections and a nightmare for the ones with slow internet. Not only does it result in a bad shopping experience, but can influence other Magento functions and make things worse. Before buying a theme, you have to check it runs fast on demo and test it with GooglePageSpeed for more detailed analysis.

2. Update to the latest version of Magento

When it comes to optimizing the speed of Magento, one of the most simple methods that you cannot forget to use is updating the latest version of it. Whenever Magento releases a new version, the performance, as well as other tweaks, will be enhanced significantly. Consequently, it is highly recommended that you update your website version to the latest one to boost the speed of your store.

3. Magento Server Configuration

Optimizing server configuration includes selecting suitable hosting and setting up server software. Magento 1 and Magento 2 performance optimization starts with following the hardware requirements:

  • Do not choose a cheap option here. It is the basis of your website.
  • Secure as many resources as you can afford and a bit more.

You might want to get more CPU and RAM if you come to Magento 2 from Magento 1. 2. x needs more of it.

4. Enable Varnish Cache for Magento caching

website-speed-optimize

Varnish Cache is an open-source web application accelerator that enables Varnish to reduce response time and network bandwidth consumption for future equivalent requests.

Path: Admin panelStores > Configuration > Advanced > System > Full Page Cache > Caching Application > Varnish Caching.

5. Enable gzip compression

Compressing is not only an appropriate solution when it comes to images. With gzip, you can compress web pages and stylesheets as well. This happens at the server level before sending them to the user browser. Gzip compression works for text files like:

  • Hypertext Markup Language (HTML)
  • Cascading Style Sheets (CSS)
  • JavaScript (JS)
  • JavaScript Object Notation (JSON)
  • Fonts
  • Text
  • and more

You can check to see whether gzip is enabled with this simple testing tool. If gzip is not enabled, you have to follow your web server’s instructions to enable gzip compression on the server-side. This can be complex and take much effort.

We want to help you. Contact us for a free consultation!

6. Setup Content Delivery Network

Moreover, you can also set up Content Delivery Network to boost the speed of your Magento store. From the Admin panel, move to Store > Configuration > General. Click Web which is under the General tab. Then, you can explore the Base URLS (Secure) section and add HTTPS URLs.

7. Enable Flat Categories and Products

Categories and Products

One of the main reasons for Magento speed problems is the database read speed. To quicken the read speed of the database, you should enable Flat Catalog. This will cut down the number of joins (joins between tables) when showcasing products. For this reason, the MySQL query complexity will be reduced.

Move to backend, STORES -> Configuration -> CATALOG -> Catalog -> Use Flat Catalog Category and put in “Yes

8. Use Magento log cleaning

Magento log slows down the database backup and your whole site. You can optimize your Magento site as well as optimize speed and performance by cleaning these logs frequently. Here’s how store owners can clean up Magento database logs without having to access Magento databases.

Path: Admin panelSystem > Configuration.

  • On the left side, under Advanced, click on System
  • Under System, view MySQL Message Queue Cleanup
  • Next step, you set the values for all of these following attributes as default or automatic clearance as per your requirements:
    • Successful Messages Lifetime
    • Retry Messages In Progress After
    • Failed Messages Lifetime
    • New Messages Lifetime
  • Click Save Config

9. Merge and Minify JS/CSS Files

There are some other methods to improve Magento speed through JS and CSS. Magento comes with some built-in tools for merging and minifying JS and CSS files.

Minification enables you to keep your JS and CSS files “clean” by removing irrelevant
data like comments, blank lines, etc. This allows web browsers to read them faster and return page requests to the shoppers faster correspondingly. Moreover, JS and CSS merging on the other hand enable you to reduce the number of HTTP requests to the server by combining JS and CSS files together.

These two options are known to boost Magento’s website speed. So, it is suggested to apply them to the website infrastructure.

Moreover, they are both configured in the admin panel:

  • Move to Stores > Configuration > Advanced > Developer.
  • Enable the Minify Javascript Files and Merge JavaScript Files in the JavaScript Settings section.
  • Enable the Minify CSS Files and Merge CSS Files in the CSS Settings sections.

Conclusion

Optimizing Magento speed is not a piece of the pie. It requires time, skills, determination, and most importantly, consistency. This is why sometimes it’s best to trust your website in the hands of professionals and allow them to optimize your Magento 2 website speed for you. Check out our Magento Website Development service and we’ll discuss the workload together to make websites much faster with super-fast page loads.