Magento 2 introduced a lot of new features, but it also increased the lines of code. These increased lines of code affect the performance of the software as there were complaints from store owners about the performance. These performance issues are not big, and these occur due to misconfigurations or when you don’t choose the right plugins and extensions.
So here are simple tricks and configurations you can apply to make it faster.
Analyze the third party extensions
Expert programmers design Magento 2 core. So improvement is not really required at a significant amount. But this is not true for the case of the extensions you add, whether free or paid, their code quality is not much assured, those might be performance issues in their own code. So these Magento extensions could affect your site and make it slow.
What you could do is perform the third-party extension audit. Try adding and removing every module and observe if there are any changes in the speed, clear caches, and then observe. If you turn off a module and experience better performance of the site, this means the module is faulty; report the issue on that extension’s forum, see if there is feedback, and they fix the problem. If you can replace it with another module, that would be a better option; go for it. If you paid for the module or extension, ask for a refund or write a review.
You will need the SSH keys provided by the hosting company and have to type this command to disable the extension or plugin:
“`php bin/Magento module:disable Vendor_PluginName“`
To turn it back on, just write “enable” instead of “disable” in the above command.
Hosting is a really important factor as the performance of your site directly depends on the machine from where it is hosted. You should carefully choose the hosting provider. Don’t go for the hosting if it is just cheap, as it might cost you more after giving a poor performance. Read the reviews. Magento 2 has machine-specific requirements which should be fulfilled to get the good performance. Few major requirements are RAM: 2GB, Storage: SSD (solid-state drive).
Turn on the caching; of course, without the caching, the site will run slow. There are many people who forget to turn on the cache and complain about the slow speed. Always check the cache settings if you get any performance issues.
Another silly mistake is not setting the correct mode. There are three modes of operation in Magento. So you are required to use these accordingly. When you host your website, you need to set the mode to “Production”. The default and developer modes are used during the development and debugging purposes. These modes should not be used on the live site.
Avoid JS bundling
JS bundling is a new feature introduced in Magento 2; it is used to reduce the number of http requests to servers that are required to load the page by bundling files using bundlers like webpack etc.
Well, this feature was supposed to improve the performance of the site, but it certainly doesn’t work like that. It makes huge chunks of data by bundling all the resources, which increases the initial loading time. So this is a performance issue; it should be avoided.
This feature was also introduced by Magento 2, and it was not present in Magento 1. We don’t need any third-party extension to minify JS/CSS. Go to the settings and turn on the minification. It compresses the JS and CSS files before sending them to the client.
Don’t use Varnish, instead use a built-in cache.
Magento comes with two types of options for full page cache: built-in application and Varnish. Varnish requires extra software to be managed on the server.
Reasons why you shouldn’t use Varnish:
An additional point of failure
Varnish is a third party software; it could break and also it requires an upgrade
It is not very good with ssl traffic
SSL is very necessary for websites nowadays. But you will face difficulty in setting up SSL with Varnish.
There are a lot of random accesses which are not cached, so they don’t get the benefit of caching.
So Magento 2 does not actually have performance issues of its own; it is very well designed by its development team. The speed and performance of the website depending on how you configure your website and the plugins you install. Hope this article helped you to improve your site’s performance.