Magento is a resourceful ecommerce platform that requires the right set of configurations for optimal performance. Because of this, it is possible that your Magento store may be slow. That’s why here in this post we will look at some of the best Magento 2 speed optimization tips, to improve the performance of your Magento store.
15 Magento 2 Speed Optimization Tips
Developers responsible for maintaining Magento stores generally make sure to incorporate Magento 2 performance optimization best practices into their projects. As a result, e-commerce stores operate at peak efficiency 24/7.
So let’s see some of the most popular Magento 2 speed optimization tips, which could add value to your Magento projects.
1. Choose the right Magento hosting
To make sure your Magento store loads faster, consider hosting it on a provider that is trustworthy and offers a smooth user experience, which translates into sales and revenue.
Hosting plays an important role in Magento 2 performance optimization. If you are looking for a reliable partner, you can choose Hostgento , with its Magento optimized solutions. These hosting solutions simplify Magento store hosting and offer many optimizations and improvements as part of the standard package.
2. Update the Magento version
Magento regularly releases new version updates, mainly focusing on platform security and Magento optimization. Therefore, the simplest and most essential tip to improve Magento 2 speed optimization is to update your Magento store to the latest version.
If you use Magento 1, we strongly recommend that you take advantage of the MageShield service , which allows you to have a site that is always safe and updated.
3. FPC for Magento 1.x stores.
Page load time has a serious impact on user experience and usually directly affects sales. To make sure your store offers a seamless user experience, use the Full Page Cache (FPC) extension for Magento 1.x stores and speed up Magento 2 landing pages and reduce server load time. This also helps in getting a better position in the Google SERP.
4. Skip the built-in cache: use varnish
Magento 2 comes with a built-in Varnish solution that offers a perfect combination of performance with visible results.
In previous versions, users had to install modules like “Phoenix” or “Turpentine” to integrate Varnish with the Magento platform. With Magento 2, Varnish integration comes by default, resulting in Magento 2 speed optimization and supersonic performance.
5. Speed up Magento 2 via Memcached or Redis
Both are distributed memory caches that speed up large scale Magento 2 web applications with dynamic databases. They reduce the load of database requests on servers and provide cached data if an external data request allows.
The choice of Redis or Memcached integrates a high-speed back-end cache with full tag cache support and no additional low-level file system cache is required. As a result, especially in high traffic Magento stores, the performance is excellent and stable.
6. Continue updating the indexers
Magento allows you to work with data in bulk, thus reducing the loading time. To get around this problem, Magento has to re-index its indexers because the central system updates the indexers on each stored object by default. However, the process is not perfect and you need to manually update the indexers.
The indexers can be updated from the Magento 1 admin panel. For Magento 2, you need to run the following CLI command on the root directory using the SSH terminal:
php bin/magento indexer:reindex
7. Inspect third party modules
Control of third-party extensions installed in the store. For this, deactivate each module one by one, clear the cache and see if this impacts the performance of the store.
Try all essential CMS pages (home page, category pages, product pages, checkout pages). If you disable a Magento module and the store gets faster, you have found the problem.
Contact extension vendors / developers immediately, ask for a refund and let them know about the problem you are experiencing.
8. Enable Magento Flat Catalogs
All store data is saved in an Excel-like Magento database. When the limits are reached, it “spills over into the extra data”. As a result, the store slows down significantly.
You can reduce the impact of “sparse” data by enabling Magento Flat Catalog Category and Flat Catalog Product. As a result, you will notice an improvement in the performance of the store.
9. A little help from CSS / JS minification
Merging and minifying CSS and JavaScript files can make the Magento web page very light and have a major impact on loading speed. Instead of sending 50 to 100 requests, the browser only needs to send two. Also, minification benefits the process with a smaller individual file size.
10. Speed up search results with ElasticSearch
Elasticsearch provides full-text search at very high speed. It offers the ability to quickly search web content thanks to the indexing service running on the server instead of searching the entire database for matches.
Elasticsearch is invaluable in keeping your Magento store search accurate and fast. This improves the user experience and ensures that customers can make good use of their time in your Magento store.
11. CDN for Magento 2 speed optimization
A Content Delivery Network (CDN) is a useful tool that caches the static content of Magento archives such as CSS, JavaScript, images, videos, fonts, etc. As a result, the store response time is greatly reduced for users.
Due to the globally distributed node locations, the CDN takes over the request process and begins serving static web content to improve page load time in the user’s browser. Set up CDNs in your Magento stores to offer a better shopping experience to your audience.
12. RM -RF * Database registers
Despite its market share and performance benchmarks, your database performance is still not up to par. A common reason behind this is the space occupied by the registers. When removed, database performance improves dramatically, due to less delay in process execution.
IMPORTANT: Before performing any operations on the database, make a new backup .
13. Switch to production mode
Running the Magento 2 store live environment in production mode is something many developers lack. Make sure this is a priority task on your Magento 2 speed optimization checklist.
Magento 2 has three modes; Default, developer and production . The production mode is optimized for performance and ensures a great user experience.
14. Community Magento Store Optimization Tips
Magento experts have shared the following crucial tips for Magento store optimization.
Artem Pugachev (CEO of Mobecls) I would
recommend the same things as they were on M1: JS, CSS, separate mobile model, poor extension profiling, robust server. However M2 offers a few more opportunities to use microservices and sets aside some substantial functionality.
Damien Retzinger (Lead Software Architect at Daffodil PWA)
The first rule of Magento 2 speed optimization is to address the abuses of the N + 1 query problem. These are typically found via profiling.
It’s nothing terribly “click-baity”, but it does explain one of, if not the, most common performance problem encountered in most custom applications (Magento stores aren’t immune to this either).
Robert Duffner (founder of Commerce Canary)
The essential tips are to work on the front end! The most important thing is to optimize for HTTP2 and not to use old solutions like default JS bundling or merging CSS / JS files. This means implementing something like Baler for Magento.
Next, concentrate on the delay of a load of images, using the intersection observer “Lazy loading” and put in the corrections for the poor use of Magento’s Dom ready. I could go on for days on this topic… I guess I could include some supposed basics, like turning on production mode, disabling logs, indexing in time instead of saving. That’s all I have for my tired brain tonight.
Piotr Siejczuk (eCommerce Solutions Architect at Accenture)
Here are some suggestions / comments from me when it comes to M2 OOTB Application Setting (s):
15. Some tips to keep in mind
- JS bundling requires a strict coding regime and may not work properly with third party modules.
- The catalog event settings are related to the use / lack of use of this feature.
- JavaScript bundle setting: NOT recommended (linked to the quality of third party extensions within JavaScript).
- To update / enable the frontend performance enhancement features, run:
- php bin / magento config: set dev / template / minify_html 1
- bin / magento php configuration: set dev / js / merge_files 1
- bin / magento php configuration: set dev / js / minify_files 1
- bin / magento php configuration: set dev / css / minify_files 1
Last but not least, I would also add CSS Critical Path and you can also check out a script I wrote some time ago.
In summary
Speed is a dominant factor in the success of an ecommerce store. A fast loading Magento store responds quickly, converts better and brings happiness to visitors, which automatically leads to increased sales and revenue.
On the other hand, a slow Magento web store would cause customers to flee the store, resulting in lost sales and a major blow to the brand’s reputation. This is why Magento developers need to know how to optimize Magento performance.
Free 30-days trial Hosting Fast, Secure and Optimized
Switch to Bhoost with 30 days free and migration included
Free 30-days trial