How to Speed Up Magento 2 Website
Speeding up your Magento 2 website is very important, it affects user experience. Customers will feel satisfied when your site responds quickly. This will create an impressive and trust of customers for your website. And the following, I will show you some ways to speed up your Magento 2 website.
1. Server
- Server is the most important component that affects web page loading speed. Choosing a good server will be based on the criteria: cost, resources, security, system requirements,…You should consider carefully to choose a good provider. With my experience, I will recommend some reputable hosting providers: Cloudways, A2hosting, Nexcess, Siteground.
- Let’s check System Requirements for Magento 2!
2. Images optimization
3. Magento Updates
Please update the Magento version each time a vendor releases a new version. It will be significantly improved performance. Therefore your site will also be improved speed.
4. Merge JS and CSS Files
Large JS and CSS files can affect the loading speed of your website. Magento developers noticed this and they built a function to merge Javascript and CSS files into one. It will reduce the number of HTTP requests and help speed up your page.
To enable merge CSS and JS files:Navigator to backend, Stores > Configuration > ADVANCED > Developer > JavaScript Settings
Merge JavaScript Files > Yes
Minify JavaScript Files > Yes
Stores > Configuration > ADVANCED > Developer > CSS Settings
Merge CSS Files > Yes
Minify CSS Files > Yes
5. Enable Flat Category and Product
You can shorten the reading speed of the database by enabling Flat Categories and Products. It will help minimize the number of databases that are involved in displaying the product, which is extremely useful for large stores with hundreds of products. In addition, it will improve the performance of MySQL queries.
Go to backend,Stores > Configuration > CATALOG > Catalog
Use Flat Catalog Category > Yes
Use Flat Catalog Product > Yes
6. Utilize Caching
Varnish Cache is an open-source web application accelerator that allows Varnish to reduce response time and network bandwidth consumption for equivalent, future requests.
Go to backend,Stores > Configuration > ADVANCED > System > Full Page Cache > Caching Application > Varnish Caching.
You can find your Magento store storage options here:System > Cache Management > Select everything and then drop-down > Enable > Submit
7. Content Delivery Network
Setting up the Content Delivery Network (CDN) is a great way to reduce the store load time, it allows your assets (product images, javascript, CSS) to be received from many other locations each other in the world. It helps your shoppers load pages faster.
To set up the CDN, please visit:
Stores > GENERAL > Configuration >> Web > Base URLs (Secure) > Input your HTTPS CDN URLs
8. MySQL Configuration Optimization
There are a few tips to optimize via MySQL configuration. You can try and get the following settings in my.cnf
query_cache_type = 1
query_cache_size = 32M
query_cache_limit=2M
In case you can get access to root to check /etc/my.cnf (or /etc/mysql/my.cnf), please login to mysql or use phpmyadmin to show variables.
In case you can get access to root to check /etc/my.cnf (or /etc/mysql/my.cnf), please login to mysql or use phpmyadmin to show variables.
Lastly, continue with a little setting for php.ini
php_value memory_limit 128M
It comes to the end of tech & tips: How to Speed Up Magento 2 Website
Speed up Checkout is very important!
You can refer to it here: How to Speed up Checkout for Magento 2
We hope this is useful blog for you.
Thank you for reading!