Customers hate slow websites. If your website loads longer than 3-5 seconds, with each extra second you lose 12% of website views, about 16% in your conversion rate, and overall customer satisfaction drops by 16%. If you don’t want to lose potential customers due to poor website performance, you should probably start Magento performance tuning right now to speed up Magento 2 website.
The good news is that Magento is an open-source platform, thus, you have full access to its source code. So you can speed up Magento 2 backend as well as make any changes to its frontend for Magento performance tuning. Some of the issues explored below can be easily eliminated without extra expenses added to the Magento developer’s services. Others require decent programming experience.
Let’s see what the most valuable Magento performance optimization tips are, and then decide which of them can or should be applied to your online store.
E-commerce Website Performance Metrics to be Considered for Magento Speed Optimization?
Although Google proposes its own recommendations for a website’s load time (2 seconds or less), every customer has their own preferences and ideas on how fast a site should load. The main rule to stick to is this: the faster the load speed, the better. However, to have a true idea about Magento site performance optimization, it is not enough to just measure the full load time and stop there. There are several other important time indicators to track when running a Magento performance optimization audit:
- Time to First Byte (TTFB) – the time needed for the first byte to reach a user’s browser after a connection to the server has been established.
- First paint – an important, but not typically regarded, point at which the user gets an indication that a page is loading (display of the background color, etc.). Before this moment, the user can only see a blank page. However, this timing does not show how fast the page load speed is.
- First Contentful Paint – the timing that shows the moment when the first content on the page is painted. This can be an image, text or any other consumable information.
- DOM interactive – the point when all HTML has been loaded and parsed by the browser, and the Document Object Model (DOM) is already built. (DOM is the way a browser structures HTML)
- Onload – the moment when all the resources, files and other content on the page have been downloaded in full.
Make Magento Faster: What are the Main Magento Performance Issues and Ways to Eliminate Them
The easiest way to get an idea of your Magento 2 site performance is to run an e-commerce website performance testing in one or several of the most popular analytics tools. Magento performance testing tools are made specifically for website owners to keep track of their websites and for up-to-date Magento tuning.
Here are the tools we constantly use to run the Magento performance testing for our clients’ online stores.
Google PageSpeed Insights
Magento 2 Pagespeed Insights is a tool that grades results on a scale from 1 to 100 points – the higher your mark, the more optimized your website is. Any mark above 85 points means your site performance is doing really well. In turn, any mark below 85 points means you need to improve Magento 2 performance, asap. With this tool you can get both mobile and desktop results for the tested webpage.
This tool assigns page results in grades from A to F. Its reports are subdivided into 5 sections that include PageSpeed results, YSlow results, waterfall breakdown, video, and history. Seven various locations are available for testing.
Of course, to test Magento speed you can use other tools like WebPageTest, Yellow Lab Tools, KeyCDN, and others, that can check any website and provide you with the performance summary. However, none of these services gives as much useful information about the site’s performance, and such detailed recommendations on Magento site performance optimization, as PageSpeed Insights and GTMetrix give.
Magento Performance Optimization Tips: Problem vs Solution
Like we mentioned above, if the Magento performance leaves its users waiting, you can look forward to low conversions, low traffic, and of course, low sales. Since the main point of your e-commerce venture is to get those sales, you’ll want to nip this issue in the bud!
Website load speed affects almost every metric a business-owner should care about: bounce rate, search ranking, conversion, page views, and above all – revenue. Thus, retailers swiftly come to a common conclusion: The faster the website, the higher the conversion.
You need to implement performance tuning for your store. Not sure where to start and how to speed up a Magento 2 website? Now that you know how to check the performance of your online store, let’s see what parts of your site should be tuned for Magento performance optimization.
First, look at the GTMetrix or Google PageSpeed Insights results of your website performance analysis. The bigger part of Magento 2 performance pain points are already listed there. Let’s look closer at each of the most burning performance problems e-commerce business owners face every day and see how each of them can be fixed.
Hosting affects the website performance on the server-side. The page generation time directly depends on the density of the websites on the physical servers and how loaded the servers are. The lack of hosting resources always results in a website performance degradation and slower load time. Sometimes, issues with a hosting result in the long downtimes, which irreversibly leads to the loss of both regular and potential customers.
Magento 2-based online stores always need a more powerful and reliable hosting ready for high loads, especially during periods of high customer activity, such as the holiday seasons. The choice of hosting is a critical issue when you need to improve Magento 2 site performance. Magento optimization should always start with a thorough revision of a current hosting provider and a hosting plan you are subscribed to. Shared hosting for $5/month is generally not a good choice for Magento. The greater your online store is, the more powerful and fast your hosting needs to be. In some cases, it is enough to upgrade a hosting plan, but some online stores will never show good performance until they are hosted on a dedicated server.
So, if you face any problem with your hosting, there are two possible solutions:
- 1. Upgrade your current hosting to an improved plan.
- 2. Switch to a Magento oriented hosting provider that will provide your online store with a dedicated server, as well as decent support and guarantees.
CDN is a network of connected servers that are used to help in faster delivery of the content. Copies of the website are stored at multiple data centers that are geographically distributed all over the world in order to provide users with faster and more reliable access to the website.
Using CDN is a good way to improve Magento performance in case your store audience extends worldwide. CDN is especially life-saving for e-commerce websites during Black Friday, Cyber Monday, Christmas, and other busy retail days. Beyond better site performance, CDN can also offer you a more secure global network.
Enable a Content Delivery Network (CDN) for your online store, and all the resources of the site will be copied to a network of connected servers, the location of which will depend on the location of your potential customers. When users open your website on their devices, the CDN determines which of the servers is the closest, and all the files (images, JS and CSS files, videos, and other resources) are transmitted to the user’s browser in the shortest way. As a result, server response time shortens and thus you increase Magento website speed.
Today, most reliable hosting providers offer a CDN connection along with their services. But if it is not available with your current hosting, you may look for CDN provider services in addition to your hosting plan. You’ll see, this is one of the most effective steps you should take for Magento website speed optimization.
One of the most useful tools for Magento site speed optimization is a Full Page Cache (FPC). Once you turn FPC on in a website admin panel, it allows for the server to retrieve and display the page in just a few milliseconds, without overloading. Thus, the website will process pages for visitors much faster.
This feature speeds up Magento backend and allows the website to remember the page content and not require it to be collected again from scratch when it comes to repeated requests. Instead, users will receive the already assembled page.
Magento has at least 14 types of cache. Learn how to set up and enable each type from this guide.
#4 Unoptimized images
Scaled images and image optimization are incredibly important to represent your products well on the e-commerce website. Images hold a great significance as you can’t sell your products without including high-quality product photos.
On the other hand, heavy images can also cause a Magento slow performance. Thus, it is necessary to optimize images so that you can deliver a faster website with quality visuals.
Every online store has hundreds of images, product photos, thumbnail images, banners, and other visuals. They are all used to attract the targeted users. But with every new image uploaded, you lose in website performance. To increase Magento site speed you can adopt one of the following techniques.
Control the size of images
Don’t make them too large or too small. Any image in your Magento 2 store should not exceed 1920px high and 1200px wide. Additionally, if you add images with poor resolution, they will appear blurred, which will not impress your customers.
Compress images wisely
To compress images without losing their quality, you can use one of the options below:
- Magento 2 extensions, like Apptrian or Potatocommerce, will optimize images once they are uploaded to the website
- Command-line tools, like Gifsicle, Jpegtran, or OptiPNG, help to perfectly compress images without quality degradation
- Run the page test through the Google PageSpeed Insights tool, and get a detailed estimation of the image size you can save after their optimization
Use WebP images
Changing the format of your images to WebP will make images 30% lighter than JPEG, and on average, 26% lighter than PNG. To convert your current images into WebP you can either use online services like Online Convert, WebP Converter, Egzif or Adobe Photoshop with a pre-installed plugin like Telegraphics and AdoveWebM.
Every website includes a lot of small images, such as logos, stars, arrows, and other elements of the interface. When a user opens the website, the browser makes dozens of requests to the server to display all those images. A sprite is an image which contains all the small interface images in one. With a sprite, the browser will send only one request to get all interface images at once. Try one of these tools: CSS Sprites, and Instant Sprite.
When uploading images to your store, let customers find your store in Google by those pictures, and help search robots to index them easier. To make this happen, do the following:
- Write ‘alt’ tags and titles for images
- Properly name images
- Create sitemaps to help crawlers find non-indexed images faster
#5 Third-party extensions
In addition to the functionality available out-of-the-box, Magento 2 provides ample opportunities for adding custom features. You can almost endlessly expand the functionality of your online store with the help of third-party extensions or custom-made functionality. However, each new feature adds new HTTP requests to the server. Consequently, it takes more time for the server to process all requests, which affects the website load speed.
In addition, poor quality or unverified extensions can conflict with each other or with other useful modules. This, in turn, can not only degrade the performance, but also make the Magento 2 speed optimization steps more complicated in the future.
With such a variety of third-party extensions available on the Magento Marketplace (over 4000), it is hard to resist the temptation to install another module. Often, on the initial audit of many of our clients’ online stores, we find dozens of installed Magento extensions, most of which are either not in use or affect the performance so much that the benefits are wasted.
In this regard, we strongly recommend that you revise all third-party extensions that have ever been implemented in your store. Extensions that are not used must be completely removed from the e-commerce store. For those that perform important tasks, but significantly slow down a website, there are several possible options:
- 1. Address the extension support team. Tell them about your problem and ask if it can be solved on the provider side.
- 2. Replace the current extension with another one that will not harm your website performance.
- 3. Optimize the extension by yourself or with the help of an experienced Magento 2 developer.
If none of the above options serve your needs, the only next possible solution is to develop the needed custom functionality from scratch. This will help to significantly speed up Magento website and improve the overall performance of your online store.
#6 URL redirects
Sometimes redirects are essential, especially when you need to tell the server that the page address has been changed. In such cases, 301 redirects help to avoid 404 errors. However, no matter how useful 301 redirects can be, when it comes to conversions, they are nothing but serious performance killers. The reason being that redirects increase your round trip time (RTT) and thus the time for loading the HTML increases too, even before the browser starts to load other assets.
Redirects are also killers of the Time To First Byte and, consequently, of website performance. The TTFB is fixed once a browser gets the first “200 OK” response from the server. Although redirects do not make Magento website loading very slow, they are the reason for another issue. When it comes to Google, officially TTFB is considered the main performance indicator of a website, and the better your website performs, the more chances you have to reach the top of the search results. So Magento TTFB optimization is a must-have.
Although it is almost impossible to completely avoid redirects, to speed up Magento 2 you should follow Google’s recommendations and minimize them. Nowadays, it’s generally accepted that server response time should be less than 200 ms. That’s why, if your website shows a lacking response time, your first move should be to minimize redirects or, even better, eliminate them. As a bonus, you will reduce server response time (TTFB) in any Magento 2 website.
#7 Server requests
The number of HTTP requests and the server response time are other factors that slow down your online store. The more requests, the longer the server response time is, and the longer it will take a page to be fully loaded. The number of server requests depends on the amount and type of content on the page that is expected to load. Every picture, every JS and CSS file, and every other separate element of the page create a separate HTTP request.
It’s obvious – you should make fewer HTTP requests from Magento.
To speed up a Magento 2 website you want to reduce the number of these requests and help the server process them faster. To minimize server requests you can use CSS sprites, optimize code, use fewer fonts, merge JS and CSS files, or apply other optimization techniques.
Reducing the number of requests is one of the most helpful methods used for Magento 2 performance optimization. Particularly, the majority of performance optimization steps are aimed at reducing the number of these requests. So, by applying the Magento optimization tips mentioned in this article you will cut the number of requests and your website performance will skyrocket.
#8 Unoptimized code
Buggy code can be found in many places throughout the website. However, most often this issue arises after the integration of poor quality third-party extensions or custom features added by inexperienced Magento developers.
Code optimization means thoroughly reviewing the existing code and its further refactoring. Some code may contain redundant lines, strange variables, spaghetti code, etc. A code review will fix all those issues. Places in the code that should be optimized can be defined manually by a developer, or with specific automatic tools that are part of a specialized software or a built-in compiler.
In some cases, with the help of a code optimization it is possible to improve Magento site speed by 20% or even more.
#9 Other Magento server-side optimization opportunities
The bigger part of loading processes are performed on the backend of the website. The speed of your website load time depends directly on the load amount and processing time. How to speed up Magento backend? We recommend that you apply the following steps.
Merging and minification can be done in several ways. Such tools in Magento 2 are available both out-of-the-box and with third-party extensions.
Enable GZIP compression
Fix 404 errors
Missing pages and missing files throughout your website result in 404 errors. Such errors may cost you on average from 60 to 100 Mb of memory just to return that 404 error code.
To avoid 404-page issues, use redirects or design such pages in a way that users who land on a non-existent page do not feel lost and can easily find a way to the page they were looking for.
#10 Keep your Magento 2 store updated
The Magento team is constantly working on improvements for the platform. With each new update, Magento 2 pagespeed shows better results and provides developers and e-commerce business owners with wider opportunities for tuning functionality and improving Magento speed & performance.
By not updating your Magento 2 store, you miss not only the newest features, but also security patches. This makes your resource an easy target for hackers.
Performance matters! Implementing Magento page speed optimization steps is an important and complex task that requires more than just a desire. There are so many possible elements that can cause bottlenecks. Of course, some of the listed tips (for example, image optimization or change of the hosting provider) can be performed by a non-tech-savvy merchant. The rest of them require at least some technical knowledge.
To find the major bottlenecks in your website performance, you should first test your store with one of the performance analyzing tools like GTMetrix or Google PageSpeed Insights. This will give you superficial data about the current website performance and indicate the points to be optimized.
We hope you now know how to make Magento website faster and are ready to confidently start down the Magento performance optimization path. Still, if you’ve got any questions, need any clarification, or are looking for professional assistance, feel free to contact us anytime. We will survey your online store and come up with a complimentary assessment outlining your Magento 2 optimization techniques and solutions.