About UsContact

12 Tips To Speed Up Magento 2 Website

By Jimmy Hung
Published in Magento 2
July 02, 2021
6 min read
12 Tips To Speed Up Magento 2 Website

Magento is a popular eCommerce platform. Even though it has its faults, Magento sites can be slow and clunky sometimes. Pages that take forever to load or are unresponsive could lead your customers to abandon the site in frustration! Have you ever tried buying something online only for pages on the website not loading properly? It’s very frustrating when this happens, right? And we know how crucial good customer service is for retaining customers! This post will show 12 ways you can speed up your webpages so both you as well as our clients stay happy.

Use a Content Delivery Network (CDN)

Use Content Delivery Network

Boosting your Magento 2 store’s performance and loading speed entails using a Content Delivery Network to help deliver content faster. Because of the heavy use of JavaScript, it can be difficult for some people with shared hosting to load all those files quickly enough due in large part because we are talking about hundreds or even thousands upon thousands of lines being downloaded simultaneously. Cloudflare is one popular choice among CDN providers, but you may also consider Amazon Web Services’ own offering known as AWS Cloudfront if that better suits your needs are given its different pricing tiers based on traffic volume levels.

Using a Content Delivery Network will boost not only your website’s page-loading time but could potentially increase conversion rates too! You might want to take advantage while there’s still time since Google gives great weight to a website’s speed when ranking search results.

Use PHP OPcache (Ex. Zend OPcache)

PHP is great for all the projects that need to be done quickly. But there’s always a trade-off between speed and quality of execution, right? This also applies when you use CMS with hundreds of small PHP files like Magento WordPress or Joomla - they are really fast at executing code but after some time their performance decreases dramatically!

This happens because PHP has an interpreter which parses scripts on each request from your browser. Precompiled bytecode cache can help reduce this problem by speeding up page loading times as it eliminates the need for script parsing every single time someone visits a website page!

Optimize images

For faster page speed, you can also optimize images which give at least 40% boost in performance. You can use an extension to reduce the file size of your images or simply resize them yourself and compress them using tools like OptiPNG, PngQuant, ZopfliPNG, JPEGOptim, etc. This will not only make your website fast but will also reduce load time and overload on your server.

If you are using a cloud CDN like Cloudflare Pro, optimization is not an issue because your image has been optimized by Cloudfare pro for you; so there’s no need to worry about it!

Enable Gzip

Gzip compression is a computer algorithm that allows for the quick and easy reduction of file size by removing unnecessary data. By compressing files, you can reduce their amount to make it easier on your servers or send them faster across the internet without sacrificing any quality. Gzip will help boost page speed because fewer resources are needed in order to load web pages when they’re compressed meaning more bandwidth available for other tasks such as video streaming!

GZIP-compressed content makes images smaller so they take up less space – this means we use fewer bytes sending information from our server to yours which also means quicker loading times!

Enable Brotli

Brotli is an open-source compression algorithm, developed by Google. It offers significant web performance improvements over Gzip and has wide browser support. Website owners can enable Brotli for their site to see a drastic reduction in loading time as well as increased engagement from visitors due to improved user experience caused by lower server loads on the hosting company’s servers (fewer page refreshes).

Brotli was created with website load times in mind: it compresses files up to 20% more efficiently than Gzip, typically resulting in 80%-90% smaller file sizes when coding JavaScript or CSS stylesheets!

Security, SSL, and PCI Compliance with Let’s Encrypt

Protecting your website with SSL will not only help you retain visitors but also boost page speed! Let’s Encrypt is an easy free way to protect any domain from being intercepted. This service automatically renews and generates a new certificate for the site, ensuring that the security of your data stays intact. With fewer sites running on HTTPS it makes sense to trust this great tool which has been proven by Google as well as other major internet companies like Facebook who have started using these certificates themselves.

Use HTTPS - always! - even when we are talking about dev environment

HTTPS always help secure your site

Do not use HTTP in Production. Always use HTTPS in all environments, but especially in production. Especially if you have CC user data access enabled. You don’t want end users who are logged into one of your sites to be sharing their login state with another site that does not require a login, do you? Well neither do I (and I’m sure most

Install and Configure Varnish Cache

Cache is very important

Varnish Cache for Magento is a must-have if you plan to scale your site. It is the fastest, most efficient, and scalable cache for Magento 2 . Varnish has been in use since 2005 by thousands of sites and is routinely used as caches for sites with millions of page views per day.

Varnish Cache will cache your Magento 2 blocks, pages, and products for anonymous users. So, even if you have high traffic, users will load the page faster.

Make sure you Magento theme or extension does not make cache disable for whole page

Please check your theme layout to make sure that it does not disable the page cache by adding cacheable=false in layout.xml . You must do this to ensure the correct URI for Varnish 4.

If your site is making more than 600 requests per second then change the Varnish Time To Live (TTL) in Magento Configuration.

Make sure that you have enough memory allocated for PHP processing power in case you need to increase it at any point in time

Server specifications is the most important thing for high traffic websites. Make sure your server has enough physical RAM allocated to PHP memory_limit.

Avoid using Magento’s default cache settings - use APC, Memcache, Redis, or another alternative instead

Using Magento’s default cache settings is not suggested for serving a lot of traffic. Magento’s cache management is not the most powerful tool and lacks granular control. One problem that you will encounter is that it creates huge number of cache files, which in turn causes major slowness .

Use Redis or Memcache as a session handler

If you think that you are running out of memory, consider using Redis instead of the default file based sessions handlers. Magento 2 support Redis and Memcache out of the box. You can configure Redis and Memcache during installation or later on using command line (i.e. your host’s CLI). I will note that some of this information is outdated, but it should give a general idea about how to configure Redis with Magento 2.

Eliminate render-blocking JavaScripts by minifying them

Minify Javascripts will make your site loads faster. It won’t make a huge difference but as we always say, every little bit counts. Magento 2 support minify Javascripts in configuration for developer and production environment.

Serve media files from remote storage

In the last of Magento version, we have remote storage for media files. When you deploy a new Magento 2 site, make sure your remote storage path is correct. If you have a site with large media files , using remote storage for media files is the best way to improve site performance. Why? Because your server just run code with small files and you can run it on RAM to make it faster. And media files are stored on remote storage like Amazon S3.

Check page speed with tools like GTMetrix before launching new changes to make sure everything is working correctly

If you check page speed with Goolge Pagespeed Insight, it maybe return bad results because of location of your server which cause the result is bad. So you can change tool to GTMetrix, we can choose location to test page such as UK or Japan. By using these two tools, you can make sure that the site is running fine and keep the speed to get green result on both of them.

Disable unused modules and features

If you don’t use them, disable them. Because they are just a part of Magento code, when enabled it will take some time to load or run on server CPU memory

Who doesn’t want a faster website? With all the great ways to optimize your site, you should never have any more excuses for slow loading times. We can help make sure that your site is optimized from top to bottom and ensure it loads quickly every time. So let us know if there are still some areas where we need improvement!


magento 2 performancespeed up magento 2
Previous Article
Building your first JAMStack website with AWS Amplify, Gatsby Starter, and Contentful
Jimmy Hung

Jimmy Hung

Free Software Enthusiast


JAMStack Development
Progressive Web App
Cloud Architecture
Magento 2

Related Posts

Problem Solved: Magento 2 Deal with Large Media Content
December 09, 2021
3 min
© 2022, All Rights Reserved.

About Us

Social Media