Magento 2 speed up is quite an important step to reach good traffic to your store. Sometimes store owners pay a lot of attention to design, sales, or social media marketing activities, but completely forget about site performance. Remember the site speed always forms the first impression. Find out more information about Magento 2 speed up in our blog post Magento 2 speed up: Way to improve effectively.
1. Magento 2 System Requirements
The server is the core. In case the one you picked is not functioning smoothly, you won’t have good Magento 2 speed up.
Before start performance optimization in Magento 2, we strongly suggest you place your store on the dedicated server. While choosing the host, run a check on these categories:
- Use the dedicated server or VPS, do not pick shared hosting option;
- Check the following System Requirements for Magento 2:
Operating systems: Linux x86-64. Linux distributions such as RedHat Enterprise Linux (RHEL), CentOS, Ubuntu, Debian, etc
Composer: Latest stable version. Composer is required for developers who wish to contribute to the Magento 2 codebase or anyone who wishes to develop Magento extensions.
Web servers: Apache 2.2 or 2.4. In addition, the apache mod_rewrite module must be enabled. mod_rewrite enables the server to perform URL rewriting. For more information, see our Apache documentation. NGINX 1.8 (or latest mainline version).
Database: MySQL 5.6 (Oracle or Percona)
PHP: 5.6.x 5.5.x, where x is 22 or greater 7.0.2 (supported by Magento version 2.0.1 and later only)
Required PHP extensions: bc-math curl gd, ImageMagick 6.3.7 (or later) or both intl mbstring mcrypt mhash openssl PDO/MySQL SimpleXML soap xml xsl zip PHP 7 only: json
PHP OPcache: PHP OPcache is strongly recommended to be enabled for performance reasons. The OPcache is enabled in many PHP distributions. To verify if it is installed, see our PHP documentation for CentOS or Ubuntu. If you must install it separately, see the PHP OPcache documentation.
PHP settings: Particular PHP configuration settings, such as memory_limit, that can avoid common problems when using Magento are recommended.
SSL: A valid security certificate is required for HTTPS. Self-signed SSL certificates are not supported. PayPal: You must use libcurl version 7.34 or later for Transport Layer Security (TLS) version 1.2 support required by PayPal.
Mail server: Mail Transfer Agent (MTA) or an SMTP server
Magento can utilize the following technologies: Redis version 3.0 for page caching Varnish version 3.5 or latest stable 4.x version for page caching Memcached latest stable version for session storage with either Memcache or Memcached PHP extensions (latest stable version) Magento Enterprise Edition (EE) only: Apache Solr 4.x RabbitMQ 3.5; Three master databases.
2. Enable Flat Categories and Products
One of the top reasons for Magento 2 speed up issues with database read speed.
To fasten the read speed of the database you should enable Flat Catalog. This will reduce the number of joins (joins between tables) when showing products and due to that, the MySQL query complexity will be reduced.
Go to backend, STORES -> Configuration -> CATALOG -> Catalog -> Use Flat Catalog Category and put “Yes”

3. Merge CSS and JS Files
Huge CSS and JS files apart from making your frontend look fancy can drop your website loading speed. Luckily, there is a way to lessen their influence in Magento 2.
- Go to backend, STORES -> Configuration -> ADVANCED -> Developer -> JavaScript Settings
- Merge JavaScript Files -> Yes
- Minify JavaScript Files -> Yes
- Go to backend, STORES -> Configuration -> ADVANCED -> Developer -> CSS Settings
- Merge CSS Files -> Yes
- Minify CSS Files -> Yes
Don’t forget to press Save Config after you are done! It’s good for Magento 2 speed up.
4. Content Delivery Network
CDN, or Content Delivery Network, is an interconnected system of cache servers that use geographical proximity as criteria for delivering web content. It actually helps your visitors to load pages faster as a result.
There are many types of CDNs, just look through features provided, geo coverage and choose the one you like.
One of the Magento 2 features is out-of-the-box support of CDN and here’s where you may find set up for it: STORES -> GENERAL -> Configuration -> Web -> Base URLs (Secure)
5. Caching
Caching can significantly speed up Magento 2 on the localhost too. Magento 2 has a variety of caching options, here’s where you can find them: SYSTEM -> Cache Management
Here you will find caching options of your Magento store, click on the ones you need, select Enable option and click Submit Page Cache can significantly reduce server response time and total page load time as result.
But M2 creates cache instance for each page (categories, products, etc) only after visiting this page and usually cache lifetime less one day.
Magento 2 module Page Cache Warmer can automatically visit pages without cache and warms cache for these pages. It’s good for Magento 2 speed up.
6. Images Optimization
Before any image upload, make sure it’s compressed . There is no need for huge images beyond your layout capabilities.
Also, pick the format that suits most of your needs. For Magento 2 speed up, with a tremendous amount of product images, it is even more crucial not to overload the site. The suggestion we have for you: use JPEG format for Product images. It is more suitable for pictures than other formats as you can compromise quality for less size. On the other hand, using PNG or SVG for layout and logo is way more beneficial.
If you already use .png
images for catalog, you can reduce image size using pngquant
utility (it reduce image size up to 80%).
This simple command will compress all .png images in the /pub/media
folder:
for file in `find pub/media/ -type f -name '*.png'`; do echo $file;pngquant $file --output $file -f;done
7. Update to the latest version of Magento
Tiny simple tip for Magento 2 speed up: do not forget to update your store. Magento team is constantly working hard on improvements in performance. So don’t miss out on any!
Let’s sum up the key points of Magento 2 speed up
- Don’t forget to enable flat products and categories to ease the MySQL queries.
- Merge CSS and JS files to make the user experience enjoyable.
- Implement CDN for your store – Magento 2 supports it out-from-the-box.
- Have caching enabled.
- Do not overload your website with high-quality images where it is not necessary.
- Don’t forget about your CMS updates.
8. Change Hosting Provider
Magento is a complicated platform with specific system requirements in order to work effectively. SSL and 2GB of RAM are necessary requirements. It will, however, vary based on your website’s requirements.
It’s a good idea to go with a shared hosting plan that caters to newbies. However, with shared hosting and the cheapest hosting package with low resources, you can’t anticipate a quick website loading time.
Check to see if your hosting provider has enough server resources to handle a given amount of users and server requests.
Furthermore, choose a hosting provider that allows you to scale up. If your current hosting isn’t meeting your Magento requirements, you might consider switching Magento hosting providers to speed up your site.
9. Audit Third-Party Extensions
The default Magento functionality will be enough for your store. However, merchants always want to keep up with the latest trends and differentiate themselves from the competition by providing unique features. Magento 2 extensions are used to accomplish this.
Magento modules make some operations easier. Besides that, they also add extra code to your website, making it more difficult. It can cause speed issues and make your website take longer to load.
The ideal option is to do an audit of your extensions and identify the “abuser,” which you can then either optimize or eliminate entirely. It is always a good idea to uninstall Magento 2 extensions that you don’t use in order to make your website lighter and faster.
You can use the following commands to disable, enable, and manage Magento 2 extensions:
bin/magento module:status
bin/magento module:enable
bin/magento module:disable
10. Use Lightweight Magento Themes
Your website theme might slow it down significantly, especially if it has a lot of widgets, sliders, and custom blocks. Consider how long it would take to load all of them.
As a result, it is horrible in every way for website users who have a fast internet connection and a nightmare for those who have a slow internet connection. It not only creates a poor client experience. But it can also have a negative impact on other Magento features.
Before buying a theme, make sure it performs quickly in the demo and test it using GooglePageSpeed for a more thorough review.
11. Remove any fonts that aren’t required.
When you’re trying to give your clients a better experience, you’ll come across a lot of trendy designs, themes, and fonts. Even if they aren’t used, the final ones can slow down website loading times.
It’s not uncommon to forget about adding a custom font to the head> section of the page configuration file. Regardless of whether or not the font is utilized, it will be loaded.
You can also try deleting unnecessary fonts to speed up Magento 2. It’s also recommended by GooglePageSpeed. Adobe gives a comprehensive guide, so removing unneeded typefaces will be simple.
12. Activate the Production Mode
If you’re a Magento developer, you should be aware of the three different Magento modes. The fastest mode is production, which should always be enabled on a live website.
Since the developer mode has been activated, some websites are not operating as expected. But it is solely for debugging purposes. To speed up your Magento 2 website, make sure production mode is turned on.
Run the commands below to:
- Check what Magento mode is enabled on your website
php bin/magento deploy:mode:show
- Activate production mode if it is disabled
php bin/magento deploy:mode:set production
13. Move to HTTP/2
HTTP/2 is an improved version of HTTP/1. Therefore, it allows websites to load faster. HTTP/2 can do this simultaneously. However, HTTP/1 generates new server connections for each static file to handle.
In 1 connection, HTTP/2 handles numerous static files. Because no time is wasted making multiple connections, the page loads and renders faster.
You can configure HTTP/2 using your CDN or web server, even though most web servers support it by default.
14. Configure Redis
Redis is another caching solution. It works well with Varnish cache in terms of usage frequency. It’s a backend caching utility. So it allows you to save sessions and session data. It provides quick access to user statuses, settings, and credentials.
Redis is a distributed data storage system that allows servers to store frequently used page content in RAM. Redis does not require constant disk access because of its in-memory data storage. As a result, the number of operations completed increases, while the latency in the search database or API queries decreases.
For better Magento performance and response, Redis caches not just sessions, but also web pages, query results, and numerous frequently used items.
15. Update Indexers
Magento’s architecture enables it to employ indexers to organize a large amount of merchant data (prices, catalog, store, and users) into tables. As a result, indexers are a way of changing and displaying product and category data on the storefront.
As a result, there’s no need to constantly calculate specific data and run sophisticated MySQL queries in Magento 2. For this, you have indexers. The core system will reindex them. you must ensure that they are configured correctly.
You can execute a reindex through CLI or reindex Magento from the admin panel in case some products don’t appear or the website speed drops suddenly.
16. Clean Database Logs
Magento stores thousands of megabytes of data in log files with various data entries. If you don’t delete your logs, your database will become congested with irrelevant data, causing delays in responding to and processing queries.
To increase Magento website speed and eliminate loading delays, it is advised that database logs be cleaned. However, before cleaning the logs, remember to make a backup.
The following are list of safe log tables to clean:
dataflow_batch_export;
dataflow_batch_import;
log_customer;
log_quote;
log_summary;
log_summary_type;
log_url;
log_url_info;
log_visitor;
log_visitor_info;
log_visitor_online;
report_viewed_product_index;
report_compared_product_index;
report_event;
index_event.
Level up your website with Magesolution – official partner of Magento
Magento speed optimization is not a simple task. Time, expertise, determination, and consistency are all required. As you can see from the list above, the workload is huge. However, it’s possible that it won’t be enough. Disabling JS bundling, upgrading to the latest version of Magento, and optimizing images may not always give the best results. It’s not because you don’t put in enough effort. It’s because there could be some concerns hidden beneath the surface that you can’t see. For that reason it’s sometimes advisable to put your website in the hands of experts and let them optimize the speed of your Magento 2 website for you.
Fill down the CONTACT FORM with your information, and experts of Magesolution will talk about the workload so that your website loads quickly as a charm.