Having your store perform out there in the wilds of the internet is a must because speed matters. Let’s take a look at a couple of things to take into account to increase your store’s performance.
There are 3 main levels to check to make sure you are not losing speed: server infrastructure and code quality.
Know your server and it’s limits. It is not always about the number of CPUs and RAMs and computational power but it helps to understand how are all the boxes in the infrastructure architecture working together.
In case you are investigating slow Magento 2 solution, check specific tools designed to help you with this, such as NewRelic. This tool will show you all the specifics of slow pages and what is the root cause behind it. It could be a faulty infrastructure design (not enough RAM), misconfigured caching, sql queries or slow modules.
Read on to learn more about Varnish caching and code quality.
Running Magento 2 e-shop without any type of caching is a non-sense. Caching is part of the e-commerce ecosystem and without it, the performance of a store will not be great.
First thing you have to make sure is that you have all caches enabled in the Magento 2 backend. Then depending on your hosting provider, try using a Varnish cache which will enable you storing your e-shop in hundreds of milliseconds.
The idea behind Varnish is that it uses URL based caching that you manage with a simple configuration. Once a customer requests a specific URL, eg. homepage, the request goes to Varnish and checks whether this URL is already stored. If that is the case, the response is returned almost instantly. In the other case, Magento responds a little slower because the request has hit a lower layer of the architecture (PHP and DB). Returned response is again stored in Varnish so the next customer can have the ultimate speed experience with your shop.
Of course there are specific parts of the site that cannot be cached, such as a cart or checkout. These URLs are on a no-cache list in Varnish so rest assured all is working well.
We have all been there and seen modules and pieces of code that just does not make sense performance-wise, eg. calling repository for an object inside of the collection.
When using multiple free or even paid modules, store owner often is not a technical person who can easily recognize code quality and whether a specific module will play nice with the others.
There is no silver lining here about these and you need a trial and error approach to find the perfect mixture.