Blog

11 tips for Magento 2 performance optimisation

 

Optimising your Magento online shop is one of the things that every Magento shop owner should do on a regular basis. Especially when sales are falling, bounce rates are rising and conversion rates are unsatisfactory. The overall performance of the Magento shop is crucial, as it not only leads to a much better ranking in search engines, but is also a decisive factor in the buying decision. If the online shop is slow, customers will leave.

It is important that you constantly monitor and optimise the performance of your Magento online store. In this guide, you will find 11 actionable tips to help you optimise Magento and give your online store the ultimate performance boost.

Reasons why Magento 2 is slow

Before we move on to tips for optimising Magento performance, it's important to understand why Magento 2 is slow in the first place.

Magento is one of the best e-commerce solutions on the market. Shop owners choose it for its unique functionality, its user-friendly administration and, of course, the possibility of a fast online shop.

However, it is not uncommon for the online shop to be slow due to an unprofessional hosting infrastructure and incorrect configuration. Below you will find the most common reasons why a Magento online shop is slow

Code "overloaded" themes and extensions

Although various themes and extensions are designed to improve the user-friendliness of your online shop, they can have a negative impact on speed. Adding new codes and features can lead to problems and slowdowns over time. Careful selection when introducing new extensions or themes for your online shop is therefore essential.

Poorly configured cache

A cache is a buffer in the background of your online shop that stores data for repeated user access and can therefore shorten the loading time. However, as the response time of the server depends heavily on the number of requests and the available resources, a poor cache configuration can be problematic and lead to the exact opposite effect: Your online shop becomes slower due to the lack of configuration.

Insufficient hosting

Furthermore, the choice of hosting provider also plays a decisive role in Magento's performance. It is very possible that the hosting chosen at the beginning was sufficient. However, as your online shop scales, more resources and more comprehensive support will be required. To optimise speed and efficiency, it is therefore essential to choose Magento hosting that has sufficient SSD storage, RAM and SSL certificates. These should be specifically tailored to the requirements and growth potential of your online shop.
 

The three factors mentioned above are the most common causes of slow Magento 2 performance. However, there are numerous other factors that can affect the speed of your online shop. To identify these, it is necessary to test the speed. Various free online tools are available for this purpose. We recommend testing your online shop with Google PageSpeed Insights. The tool provides reliable performance reports and gives you advice on how to speed up Magento.

Steps for optimising Magento 2 

Once you know the reasons why the performance of your online shop is unsatisfactory, you can focus on implementing the following tips 

1. Update to the latest version of Magento

One of the first steps to speeding up Magento is to regularly update the software. New versions are released every few months and bring with them many new features, bug fixes, platform enhancements and speed improvements.

It is not recommended to use an old version, as this will sooner or later lead to major problems in your online shop. Therefore, download the latest Magento version and update it regularly to ensure fast and smooth performance of your online shop.

2. Change hosting provider

Magento is a complex platform that must fulfil certain system requirements in order to function properly. Therefore, make sure that your Magento hosting provider provides you with enough server resources to host a certain number of users.

Also choose a hosting provider that offers you the option of continuously expanding your offering. If this is not the case or if your current hosting generally does not meet your Magento needs, you should consider changing your Magento hosting provider.

3. Check third-party extensions

In order to keep up with the latest trends and stand out from the competition, online retailers are constantly turning to Magento 2 extensions. Although these make some processes easier, they can also consume a lot of resources and have a negative impact on the loading times of your online shop.

It is best to document exactly which extensions you are using. Then carry out regular audits of your extensions to find the "culprits", optimise them or remove them completely.

4. Use lean Magento themes

The Magento theme you choose can also slow down your online shop considerably, especially if it contains a lot of widgets, sliders and custom blocks. This is bad in every way for users with a good internet connection and a nightmare for all users with a slow internet connection. Not only does it lead to a poor customer experience, but it can also affect other Magento features and make the situation worse.

Before you buy a theme, you should therefore make sure that it runs quickly in the demo. We also recommend testing the theme with GooglePageSpeed before use to get a more accurate analysis.

5. JS and CSS minification

With so-called "minification", all superfluous characters are automatically removed from the source code without affecting the functionality. This can include the removal of comments, spaces, shorter variable names and functions to reduce the file size and shorten the overall loading time.

Minification is also possible for your online shop: Magento 2 offers an automated option for minifying JavaScript and CSS. To do this, navigate to the developer settings in the admin panel and set the options for "Minify JavaScript Files" and "Minify CSS Files" to "Yes".

The illustration shows the CSS and Javascript settings in the Magento backend

6.  Activate the critical CSS path

CSS styles that are loaded from external files are considered "render-blocking", which means that a web page will not be displayed until these files are fully loaded. To shorten the time until your pages are displayed for the first time, you should use the so-called "critical CSS path". The critical CSS is placed inline in the <head> after it has been minified, while all non-critical styles are loaded asynchronously.

The CSS configuration for the critical path is located on the Stores > Settings > Configuration > ADVANCED > Developer  

7. Delete unnecessary fonts

When online retailers try to offer their customers a better shopping experience, many experiment with trendy designs, themes and fonts. These design elements can slow down the loading speed of the online shop and should therefore be chosen carefully.

For example, it can happen that a custom font is inserted into the <head>-section of the page configuration file and then forgotten. Regardless of whether the font is used or not, it will be loaded every time.

If your fonts are loaded from a third-party server (such as Google Font), it is also recommended to download them and serve them from your own server to reduce loading times. Also try to convert your font files to woff or woff2 formats, which are lighter and supported by all browsers.

8. Optimised images in the shop 

When users visit your online shop, the entire page content is loaded at once. There are many images of different sizes that take time to load, which leads to a delay in loading the page and the online store in general. Optimising the speed of Magento 2 and optimising images go hand in hand. 

One of the best ways to increase loading speed is to use lazy loading. This is a method of loading images as customers scroll down the page. Lazy loading means that instead of loading all images at once, only the images that are actually being viewed are loaded.

In addition to using lazy loading for images, it is also advisable to optimise images by converting them to webp format. However, Magento does not allow you to upload or use this format by default. It is therefore necessary to install an extension to enable this.

9. Clean up data logs

In extreme cases, these logs can take up thousands of megabytes on your server and significantly slow down the server's processing speed. This can even cause your online shop to stop responding. 

It is therefore very important to clean up the Magento database logs regularly to keep the server clean and improve the performance of Magento 2. To do this, go to Admin Panel > System > Configuration and click on System under Advanced. There you will find an option to clean up the logs. Even if you no longer need the logs, it is a good idea to back them up before cleaning them up. Then select the options you want and click Save.

To save time, you can also use Magento 2's cron job functionality for the cleanup. A cron job allows you to create and execute commands and tasks at predefined intervals, dates and times. For example, you can easily create a custom cron job in Magento 2 to delete the database logs on a regular basis.

10. Use a content delivery network

The integration of a content delivery network (CDN) can significantly speed up the loading times of your Magento shop. A CDN is a network of servers that are distributed across different geographical locations and store cached versions of your online shop's content. When a user accesses your online shop, the content is delivered from the server closest to the user, resulting in faster loading times.

11. Code optimisation 

Well-written code is crucial for a high-performance Magento shop. For this reason, we recommend regular code reviews and the use of PHP accelerators for better performance. It is important to remember that every Magento shop is unique, and therefore there is no standard solution for optimising performance.

At Arcmedia, we are here to help you with these challenges. We do everything we can to find the best solutions for your specific needs and to bring the performance of your Magento shop to the highest possible level. An example of this is the use of the Hyvä frontend theme for Magento, which maximises performance by reducing the amount of code delivered. Hyvä achieves a Google PageSpeed score of 100/100 and outperforms Core Web Vitals in all metrics. Sounds impressive, doesn't it? 

If you would like to find out more about how we can help you optimise Magento performance or if you would like to use Hyvä as a demo, please contact us via the contact form. We look forward to hearing from you!

Conclusion

Magento is a robust and flexible e-commerce solution that shop owners can configure according to their requirements. The acceleration of Magento 2 can help online shop owners achieve higher search engine rankings and improve the overall user experience.

We have presented 11 tips that you can follow for performance optimisation so that your online shop will continue to load at lightning speed in the future. Haven't had enough of Magento? Then we recommend reading our guide "All about Magento: A comprehensive guide" to learn even more about the exciting e-commerce solution. 

Author
Alena Klemenjak works in the digital marketing and communications team at Arcmedia. She deals with all issues related to social commerce, social media, marketing automation and search engine marketing. Alena is happy to share her expertise on these and other relevant digital marketing topics.