Speed up Magento 2: 15 Proven Practices for Every Store Owner

speed-up-magento-2

Do you run your business on Magento and does it loads very slow?

Planning to migrate your store to Magento 2?

Well, it turns out, you can dramatically speed up your Magento 2 store with a few simple website tweaks.

15 Proven Ways to Speed Up Magento 2 Store

  1. Full Page Caching
  2. Choose Fastest Magento hosting
  3. Select Production Mode
  4. Enable flat catalog
  5. Merge & Minify CSS, JS Files
  6. Clean Magento Logs and Database
  7. Image Optimization
  8. Avoid JavaScript bundling
  9. Perform 3rd-party Plugins Audit
  10. Optimize TTFB
  11. HHVM (HipHop Virtual Machine)
  12. Optimize Your Code
  13. Have fewer modules and extension
  14. Install a CDN
  15. SQL Configuration

Why people prefer Magento over others?

Developers opt for Magento for building e-commerce sites for the following reasons:

1. Magento is Open Source

Yes! Magento is Open Source and free to use. The 3 versions of Magento are:

  • Magento Community Edition (free)
  • Magento Enterprise Edition (paid)
  • Magento Go (paid)

Magento Community Edition is used the most by the developers’ community.

2. No Incremental Charges

You don’t need to pay any extra charges when you grow bigger unlike other ‘made for e-commerce’ platforms like Volusion and Shopify.

3. SEO-Friendly

Magento is considered to deliver SEO benefits, hence giving you greater visibility and organic traffic.

Slow Speed can Hurt your Business

The slow speed of your Magento store can impact your sales metrics negatively, and also harm your conversions.

According to Retail TouchPoints, a 0.1-second delay in your site can hurt 7% conversions!

speed up magento 2

You can’t afford to disappoint your customers due to the poor performance and speed of your Magento store.

Reasons for Slow Load Time of Magento Store

  1. A surge in HTTPS requests.
  2. Failure to deploy a Cache system or a Content Delivery Network.
  3. Heavy-weighted Web pages.
  4. Server Latency

There could be other reasons too but can only be identified after thorough introspection of the website.

Speed Up Magento 2 Infographic

Speed Up Magento 2

Download

15 Proven Ways to Speed Up Magento 2 Store

  1. Full Page Caching 
  2. Choose Fastest Magento hosting
  3. Select Production Mode 
  4. Enable flat catalog
  5. Merge & Minify CSS, JS Files 
  6. Clean Magento Logs and Database
  7. Image Optimization
  8. Avoid JavaScript bundling 
  9. Perform 3rd-party Plugins Audit 
  10. Optimize TTFB 
  11. HHVM (HipHop Virtual Machine) 
  12. Optimize Your Code
  13. Have fewer modules and extension
  14. Install a CDN
  15. SQL Configuration

1. Full page Caching

Caching is the key to super fast speed. Your eCommerce store loads much faster when there is a minimum load on the server. It’s like feeling light and energetic when your mind is at peace.

Full-page caching works amazingly well when it comes to speed up your Magento 2 stores. The rule of thumb here is to keep your server as light as possible.

Here’s how you do it:

System > Cache Management > Select all > Enable > Submit

speed up magento

2. Choose the Fastest Magento Hosting

Well, it’s an obvious one! Hosting is the foundation of your M2 store. You can put everything in place perfectly still your site can go sluggish if you are with the wrong host.

You can’t have a fast Magento 2 store on a cheap VPS.  Therefore, you must have a fast, reliable web host to improve Magento 2 performance. 

Seek following 3 things from your Magento 2 web host:

  • High-security standards
  • High-speed connection
  • 24*7 customer support

P.S. With a faster managed hosting success is sure. Furthermore, many managed Magento 2 hostingproviders are there to provide 24*7 customer support and handle all your issues beautifully. Thus, it will be another win-win for you as they promise better speed, 100% uptime, bullet-proof security and more.

Magento hosting

3. Select Production Mode

When we talk about Magento 2 performance optimization checklist we can’t skip this one. Because it improves your store’s performance significantly and is specially crafted for Magento 2 platform.

M2 incorporates three running modes: default, developer, and production. Running your store on default or developer mode won’t do any good to your site speed.

So, in order to speed up Magento 2, always run your store on Production mode; amongst all, production mode is the fastest.

Here’s how you do it:

php bin/magento deploy:mode:set production

4. Enable Flat Catalog

Magento is based on EAV model (entity attribute value) to store product and customer data.

What happens when you enable the flat catalog?
  • Merges data into one.
  • Improves performance by responding to MySQL queries faster.
  • Beneficial for those eCommerce stores having 1000+ products.
How to do?
  1. Go to “Stores” → “Configuration” → “Catalog.”
  2. Under “Storefront” change “Use Flat Catalog Category” and “Use Flat Catalog Product” to “Yes.”
  3. After this, “Save Config” and clear the cache.
magento flat catalog Speed up Magento 2

5. Merge & Minify CSS, JS Files

Magento 2 comes with an option to merge, minify and bundle. Make the best use of it because you will get rewarded with enhanced Magento performance and great speed.

Merge and minify both CSS and JavaScript files to make the web page as light as possible, and ultimately speed up your Magento 2 store.

Here’s how you do it:

4.1 Merge & Minify CSS

  • Open backend
  • Stores > Configuration > Advanced > Developer > CSS Settings
  • Set “Yes” for both Merge CSS Files and Minify CSS Files Options
Magento speed

4.2 Merge & Minify JS

  • Open backend
  • Stores > Configuration > Advanced > Developer > JavaScript Settings
  • Set “Yes” for both Merge JavaScript Files and Minify JavaScript Files Options (like done in the image).
speed up magento 2

6. Clean Magento Logs and Database

Since Magento keeps logs up to 180 days, your database can become heavy.

It is advisable to change the setting to the lowest value, i.e, 14 days and clicks on “Save Config”.

For manually cleaning up the database, you can:

  • In phpMyAdmin, select all of the log_% tables and select “Empty” from the drop-down.
  • Select “Yes” when it asks to TRUNCATE the tables.
clear magento logs

7. Image Optimization

Since images account for 50% to 60% of your web pages’ total weight (Radware, 2015), it becomes crucial to optimize images to speed up Magento.

Must Read: An Ultimate Magento Security Guide You Need

Benefits of optimizing images:-

  • It can dramatically increase the speed of your pages.
  • Images can be compressed before uploading with tools like PhotoShop or other auto-optimize tools.

For Magento version <2, users can choose the following extensions:

  • Compressor Extension
  • TinyPNG Extension

8. Avoid JavaScript Bundling 

Although bundling is an innovative feature brought by M2, JS bundling is not something you wanna do if you are already using HTTP/2 and really want your site to speed up.

Why? Because the bundled JS file is huge in size; it takes around 5-13 Mb of space. It can make your M2 store speed suffer significantly.

9. Perform 3rd-party Plugins Audit

This is probably one of the most important steps to enhance your store’s performance. Custom extensions make Magento 2 heavy and sluggish; the more is the no. of 3rd-party plugins the slower will be your store.

Thus, performing a 3rd-party extension audit can give you a sigh of relief.

Custom extensions do more harm than good. Many 3rd-party plugins are created by amateur coders whereas Magento 2 core is written by world-class professionals. So, which one would you choose?

Obviously, the one that comes straight from the experts and makes your Magento faster will be the right choice!

Here’s how you do it:

  1. Disable all the custom extensions one by one
  2. Benchmark speed with and without an extension
  3. List out the extensions that take the most time to run
  4. Contact their vendors and ask to patch
  5. In case of no patch, just remove the extension and find a substitute

Tip: JMeter is our favorite tool for benchmarking. You can use this tool to check which custom extension is making your site slow. 

10. Optimize TTFB

TTFB or Time To First Byte is the time a browser’s request travels to the server and the server responses back to it (latency).

This is why Time To First Byte is also referred to as Server Response Time. It is also the time when the server generates HTML.

What is TTFB?

Google suggests that your TTFB should be much lesser than 200ms. Otherwise, it’s considered bad TTFB. Thus, the Server Response Time Audit is a quintessential task to speed up Magento 2 and rank better on Google.

Read TTFB All you need to know about time to first byte

TTFB

11. HHVM (HipHop Virtual Machine)

HHVM is a special open-source virtual machine or server software based on JIT (Just-In-Time) compilation that eCommerce store owners can install and hook up with Magento 2.

It replaces php-fpm and can work with Nginx or Apache.

Being a store owner you should use it because many famous brands like Facebook are also using HHVM to do better and load fast!

12. Optimize Your Code

There is no surprise that complex PHP code in Magento makes your site slow. Optimizing your code becomes a necessity when you are using a heavy platform like M2.

To make it easy on you, we have divided this point into several segments:

9.1 PHP Accelerators:

For the heavy PHP coding, you can use the PHP accelerators for code optimization.

The PHP accelerators cache the PHP scripts used in the web page and make your store faster.

9.2 Reduce third-party JavaScripts:

Inspect all the third-party JavaScript files in your Magento 2 store carefully. Use random, third-party JS codes with caution and always run a test for speed.

9.3 Disable/Limit PHP Modules:

Since many PHP modules do no good to your website speed and still sit back there to make your M2 store slow.

You must uninstall the unwanted PHP modules from your coding section to clean up space.

9.4 Don’t abuse jquery.ready:

Sometimes we put CPU intensive tasks in jquery(document).ready. This ultimately slows down the page loading speed. Therefore, choose onLoad events very carefully so as to avoid any lag.

13. Try to Have fewer Extensions & Modules

More the extensions, the more HTTP requests, CSS and Javascript files there will be.

This will result in increased load time. Keep your Magento with as few extensions as possible.

For disabling the modules, you can follow these steps:

  1. Navigate to “Stores” → “Configuration” → “Advanced”→ “Advanced”.
  2. Click “Disable” on the modules you don’t need. Further, select “Save Config.”

14. Install a CDN (Content Delivery Network)

With CDN, you can decrease the load time drastically.

A Content Delivery Network is a large distributed system of servers that store files and web content closer to the user requesting them.

  • Closer the CDN server to a user = Faster content will be delivered to the shopper.
  • It ensures that your product images, CSS, and Javascript are loading faster to your users.
  • It also offloads some of the server’s stress and leads to fewer processes being required per customer, reduced bandwidth costs, and improved response times.

15. MySQL Configuration (Query Caching)

Every time a Magento page is loaded, there are a series of database queries made and the database server must go to work. The long query process takes times and there is slower disk access which results in lower performance.

Solution: MySQL has a built-in configuration parameter known as query_cache_size. This helps to store the result of the query in memory which is much faster than accessing from disk.

Conclusion

It’s not rocket science to speed up Magento 2 store’s performance and boost your sales. It’s as simple as practicing the given tips and tricks.

Note: For an instant boost in your eCommerce performance combine all these amazing tips with the fastest managed Magento hosting in the market. Because above all, your eCommerce store requires a good host to work fast and be secure.

Don’t have the time or expertise? Talk to our experts and we will analyse, optimise, and manage your Magento site to the best.

Latest Magento Tips, Guides, & News

Stay updated with new stuff in the Magento ecosystem including exclusive deals, how-to articles, new modules, and more. 100% Magento Goodness, a promise!

Leave a Comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top

We can help you. Right now.

Fast growing merchants depend ServerGuy for high-performance hosting. Experience counts. Let's get started.

Talk to a sales representative

USA / Worldwide

+1.714.2425683

India

+91.9852704704