Blog

Speed up Magento 2 | Site speed optimization of magento2 site

Is your Magento site very slow?

There are numerous ways we can speed up the site. And also there are numerous reasons for site working slow.

In this article, I have given 10 tips to increase the speed of the site quickly.

1. Choose the fastest hosting you can afford

The hosting plan you choose plays an important role in overall website’s performance. You can’t have a fast Magento2 store on a cheap VPS.

Magento 2 has specific technology requirements. You can have a look at the system requirement here. You can not expect decent speed if you don’t meet either one of those two criteria.

2. Update to the latest version of Magento 2

Whenever Magento releasing a new version, the performance, as well as other tweaks, will be improved significantly. Consequently, it is highly recommended that you update your store version to the latest one to improve the speed of your store’s site.

3. Use a lightweight fastest Magento theme

It’s highly recommended using a lightweight fastest Magento theme as it can help you improve the loading speed of Magento 2 significantly.

4. Enable Flat Categories and Products

The very important factor for increasing the speed is the database loading of the website. Flat Catalog allows offloading the number of the database once there is any request for showing the product. In the configuration, enable Flat Catalog to speed up that. One more benefit of enabling these settings are the MySQL query complexity will be reduced.

Go to backend, Stores > Configuration > Catalog > Catalog > Storefront, choose Yes in Use Flat Catalog Category field. and hoose Yes in Use Flat Catalog Product field.

 

5. Turn Off Unused 3rd-party extension

It is always good practice to delete unused extensions from the file system, they will just be an unnecessary security risk.

To turn off the extension you will need SSH access. Most hosting companies will allow you to access the server via SSH and will provide you with necessary credentials.

Once you are logged in issue this command to disable VendorName_PluginName plugin:

php bin/magento module:disable VendorName_PluginName

To turn it back on run:

php bin/magento module:enable VendorName_PluginName

There are some extensions which makes the site work very slow.  So you can check individually the extensions for its performance by disabling those.

6. Turn Caching On

Go to backend menu System > Cache Management and double check the settings. It should all be green and look like this:

 

 

Enabling cache, speed the website.

7. Turn Production Mode On

Magento 2 has three modes of operation: default, developer and production. The fastest one is production. Default and developer modes are used for debugging purposes and should never be used for a live site.

You will need to get SSH access details from your hosting provider to find out what mode you are running in now. The command is pretty simple:

php bin/magento deploy:mode:show

Run it once inside the root Magento folder.

To set production mode issue this command:

php bin/magento deploy:mode:set production

 

8. Never Use JS Bundling

JS bundling is a special feature of Magento 2. It is supposed to cut down a number of HTTP requests required to load a page by grouping JavaScript files.

It is supposed to be good for performance but it is actually not. If you activate JS bundling it would create a huge 5-10Mb file with all the Javascript code. The file that big would negatively impact page load time.

Many elements on web page was a problem a few years back, but all decent M2 web hosts should now run SSL and HTTP2.

You can double check JS bundling is off by going to backend menu Stores > Configuration > Advanced > Developer:

Javascript Settings:

 

9. Enable CSS/JS Minification

This is another special Magento 2 feature that was absent in Magento 1. You now can minify JS/CSS files with no need for 3rd-party extension.

Go to Stores > Configuration > Advanced > Developer and set minification on:

CSS Settings:Javascript Settings:-

 

Keep in mind these settings only work in production mode.

 

10. Optimize Images

On your store site, there are tons of product images. This might slow down your Magento speed if these images are not be optimized properly.

Here are some key points in image optimization:

  • Images need to be compressed.
  • Using Image Otimizer module
  • Your store’s logo should be in PNG or SVG format.
  • The image of product should be in JPEG format.

This is how we can speed up the Site speed of Magento2 store.

Hope this article helped you. Do comment below giving feedback.

Happy Learning !!

Thank You !!

Leave a Reply

Your email address will not be published. Required fields are marked *