How to Speed up Your Magento Store [The Ultimate Checklist]
April 28, 2022
If your online store is built on Magento, then you’ll be well aware of the great ecommerce functionality it provides.
But if you’re a scaling brand that needs to go the extra mile for your customers— displaying high-quality images, embedding video, and engaging visitors with unique, personalized shopping—then you might have found your site’s performance starts to suffer.
So what can you do to maintain your distinctive, reputation-building site without sacrificing speed? That’s what we’ll cover today.
How to speed up your Magento 2 site
Magento has made its reputation by providing robust ecommerce functionality and the tools to create the great sites your customers expect.
But while Magento sites can be very fast, they can dramatically slow down if you start to build out additional features. To avoid this, there are some steps you can take to make sure your Magento store keeps its speedy load times (and save yourself from SEO setbacks).
In this post, we’ll take a look at what you can do to maintain fast-loading pages and rapid response times as you elevate your ecommerce store.
But before we get into the nuts and bolts of the process, there are some easy wins every Magento store owner in search of a faster site can achieve.
✅ First: find out how fast your Magento site is
Before we discuss the best Magento 2 speed optimizers, you need to know how fast your site is currently. We’ve got a comprehensive guide to site speed that walks you through this, but to summarize, you can use the following speed testing tools to find out how your site performance measures up:
- Google Lighthouse – free and accessed through Chrome DevTools. You can access your speed score and see suggested improvements.
- PageSpeed Insights– also free and easy to use by entering your URL on the site.
- Pingdom Speed Test– A freemium service with a detailed breakdown of your site’s performance.
- GTMetrix– Another freemium product with lots of helpful features if you subscribe.
If you’re looking for a more Magento-specific speed test, New Relic is recommended by Adobe to test site speed in a live environment where you can assess how fast your ecommerce site appears to real customers.
✅ Follow general site-speed optimization best practices
There are several things that you can do to make sure your site is running as fast as possible, whether it’s a Magento store or not. So before you start to figure out how to properly optimize your Magento site, make sure you’re getting the basics right and following these site speed best practices:
- Use a CDN (Content Delivery Network) – You should choose a hosting company that operates as a CDN [Jump link to ‘Use a Content Delivery Network (CDN)’ here].
- Enable browser caching – Allowing site visitors to store key information from your site helps it load quicker the next time they visit. Again, there’s a lot of Magento-specific caching techniques that we’ll cover later on.
✅ Audit and manage your third-party extensions
Extensions can be a great way of adding functionality that doesn’t come standard in Magento. But not every extension is written with the most efficient code. You can identify extensions that are dragging your site’s performance down by performing an audit.
There are several ways to do this, but the simplest way is to disable your extensions, then run a speed test, then turn the extensions back on one by one.
If you find your speed drops significantly after a particular extension is re-enabled, you’ve found the culprit.
From here, you can either edit it to make it more streamlined (but you’ll need some programming experience to be confident enough to go tinkering under the hood,) or you can remove the extension entirely and find a better-written replacement.
✅ Update to the latest version of Magento
If you’re using an older version of Magento, your site will not be as fast as it could be, so you should update to the latest version. Updating is not a difficult process, just make sure you back up your site and switch to maintenance mode before you do it.
If you’re still using Magento 1 or the early versions of Magento 2, updating will also open the door to headless commerce. From Magento version 2.3 onward, Magento has supported headless APIs, allowing you to create your own storefront that’s not reliant on Magento’s backend technology.
Going headless is a step-change for site speed, as you can harness the power of progressive web apps (PWAs) to generate lightning-fast sites and exceptional user experiences. If you’ve tried other methods of speeding up your Magento site and still find the load times are sub-optimal or that you have to sacrifice elements of your customer experience to speed up Magento, a PWA on a headless set-up may be the logical next step.
#cta-visual-fe#<cta-title>Take your store headless the easy way.<cta-title>Learn how Shogun Frontend can help you achieve the exact ecommerce experience you envision. Learn more
✅ Ensure you have a great hosting provider
Whatever commerce platform you’re using, choosing a quality hosting provider is a prerequisite for a fast-loading site. As Magento is resource-heavy, making sure your hosting provider will be able to allocate enough space to handle all your traffic is especially important. Before you commit, check that your hosting provider can accommodate Magento’s minimum specifications.
A CDN hosting solution will bring your site data closer to the end-user, enabling faster load times.
Once you’re set up with CDN hosting, make sure to configure your Magento site to be delivered via CDN. You can do this from within the Magento admin panel, and Adobe has this step-by-step guide on how to do it.
There are a number of hosting companies that offer tailored Magento hosting solutions including:
- Cloudways – A fully managed hosting service specifically designed for Magento sites. Cloudways uses the cloud capacity of other high-end hosting services like AWS and Google Cloud but provides lots of Magento hosting speed optimizations on top.
- AWS – You can skip the middleman and set up AWS hosting for your Magento store yourself. Amazon Web Services is the biggest cloud hosting provider in the world, with all the advantages in infrastructure and investment that brings with it. Setting up AWS hosting by yourself will require some technical expertise to make sure you’re optimizing your speeds and keeping costs down.
- SiteGround– A popular choice for Magento site owners due to its extensive support, customer service, and tailor-made Magento hosting features.
- Magehost – Is a bespoke Magento hosting service that offers tiered pricing according to your needs. It also boasts access to Magento experts to help you with setup and maintenance.
- Nexcess – Offers fully managed Magento hosting and is often considered the hosting service of choice by Magento developers because of its range of Magento-specific optimizations.
Obviously, this harms your site’s performance, so setting your site up to handle JS the right way is crucial.
✅ Optimize your JS bundles
To reduce HTTP requests, JS files are often bundled together into one big file, in theory speeding up the process of getting data to the visitor.
However, some of these JS bundles can get very big, and Magento loads these bundles wholesale with each new request, resulting in slower response times—the exact opposite of what was intended!
To get around this problem while still maintaining an efficient JS requesting process, you’ll want to enable advanced JS bundling or deferred JS loading.
✅ Minify, don’t merge
Another method that’s often touted as a way to reduce HTTP requests is to merge JS and CSS files so these files can be delivered at the same time.
But there is a good reason not to crudely merge your JS and CSS files: the advent of HTTP/2. This major new version of the universal internet protocol can handle requests for data simultaneously rather than one at a time.
It means that there is no longer a need to bundle up your files to save time as this is done natively in HTTP/2. This has been a relief for Magento store owners as the CSS and JS merging tool in Magento is a little over-zealous in combining files, resulting in very large files that slow down a site visitor’s browser as they move around your site.
So you should disable merging and instead minify your JS and CSS code (see above for how.)
✅ Eliminate the problem with a PWA
If you’ve created your Magento site with a PWA, the CSS and JS is stored in a cache on your customer’s device, so there’s no need to send requests to servers to load the static (unchanging) parts of your site.
Storing static parts of a site in the visitor’s browser has the added advantage of making your site readily available when there is poor network coverage, or no access to the internet at all, making PWAs a very attractive option for mobile customers.
#cta-paragraph-fe#A headless solution to Magento speed problems. The speed tips we suggest here are great for stores looking to boost their site speed with manual fixes. But if you’ve scaled past the point where piecemeal manual fixes will significantly improve your speed, then it could be time to explore a demo of how Shogun Frontend can help you take your Magento store headless. Learn more about how a headless solution can give you the speed and flexibility your brand needs here.
More on Magento caching…
Caching is the practice of storing site information in a readily accessible place much closer to the end-user than where your servers are located. This can be in a proxy server or even on the visitor’s browser itself.
This is a handy way to speed up page loads for pages that don’t require fresh information (ie, are not dynamic.) When a visitor clicks on one of your pages a request is made from their browser to your database, and the information required to load the page is sent back to their browser. If your database is located on servers potentially thousands of miles away from the site visitor, this can be slow and laborious.
If the request is for a page that contains unchanging information (like a home page), this can be dramatically sped up by allowing a copy of that page to be stored (cached) in a proxy server (or reverse proxy server, to be more precise) located much closer to the site visitor.
Varnish – is a reverse proxy that supports full page caching for public pages. Varnish stores these pages closer to the client (ie, the site visitor’s device) and so can serve them up much quicker than if the client had to make a full database query to your servers.
Adobe recommends Magento customers use Varnish to handle full page caching rather than the caching tool that comes as standard.
Adobe has a full walk-through on how to install and run Varnish in Magento.
Caching dynamic pages with Redis
So now we’ve looked at how to speed up your Magento store’s static pages with full page caching, what about those personalized, dynamic pages that are updated during a customer’s visit to your site?
For this, you’ll need to use a backend caching solution like Redis or Memcached (Redis is now the recommended option, replacing the older Memcached.)
Redis works by creating a cache of data on your site visitor’s device. It creates it in the device’s RAM (Random Access Memory), which is much more easily accessible than the disk drive.
So during a site visitor’s session, when a customer might be making changes like adding products to cart or updating their profile, this dynamic data is stored in their device’s RAM and can be quickly accessed and updated, meaning their experience of using your site is a fast and efficient one.
How to manage your catalog updates
In any ecommerce store, there is a huge amount of information that needs to be updated regularly (for example: product prices) This changeable data can be difficult for Magento to find and can potentially cause problems when loading pages.
Luckily, Magento provides solutions for these issues.
✅ Disable flat catalog mode
Magento experts have, in the past, advised enabling Flat Catalogs.
The logic for this was that it makes for fewer database queries. This worked great in Magento 1 and the first release of Magento 2. But From Magento 2.1 onwards, Adobe has advised disabling flat catalogs as it causes performance issues.
You can do this by navigating to the catalogs section of your configuration settings in the admin panel, then set Flat Catalogs to ‘No’.
✅ Update indexers on schedule
In any ecommerce store, lots of information needs to be updated regularly.
This changeable data can potentially cause problems when loading pages. If you change the price of a product, for example, and this product is loaded onto a page, the page load process could involve some complex queries to the database, which would cause a significant lag while the updated information is retrieved.
To get around this, Magento stores this type of data in easily accessible tables (or indexers).
But this creates a new problem: indexers can become bloated and unwieldy if they are not updated correctly. The best way to keep your indexers in check is to set indexers to update on schedule in the admin panel.
Bonus Magento speed tips
Now we’ve covered the main areas to look at to boost Magento site speed, here are a few other tips you can make use of to increase the speed of your Magento site.
✅ Clean up your Magento logs
Magento (and all databases) create logs to keep a record of executed tasks and help solve things that have gone wrong. As you use Magento over time, these logs can build up to take up a large amount of storage space, increasing the time it takes to perform tasks.
Magento is aware of this issue and provides an option to clean logs in the configuration settings. You should do this once a week to avoid logs taking up unnecessary space.
✅ Don’t forget to switch to production mode!
When you’re building your Magento site, you’ll be doing it in developer mode. But when you go live, you should switch to production mode. It’s a step that not everyone knows about, but you should check with your developers that they’ve made this change before you launch your site.
Summing up—a fast platform when you get your set-up right
Magento provides stellar backend functionality combined with the ability to create fast-loading, impressive sites and stores. But if you need more than the out-of-the-box functionality Magento offers to create the site you want, then speed can become an issue.
There are lots of manual fixes that can help mitigate slowdowns or compromises to performance, several of which we’ve covered here.
But if you’re looking to take your online store to the next level, a PWA-based, headless approach could be a better solution.
#cta-visual-fe#<cta-title>Exceed limits by taking your store headless.<cta-title>Learn how Shogun Frontend can help you achieve the exact ecommerce experience you envision. Learn more
Rhys is a writer specializing in enterprise software, ecommerce, and SaaS. He describes himself as a geek and a wordsmith and relishes making complex, technical topics come to life in easy-to-understand web copy.