“47% of consumers expect a web page to load in less than 2 seconds.”
“21% mobile users said that they expect load time on their smartphones to be equal to that of desktop.”
If you own an online e-commerce store, page loading speeds are very important. And if you don’t own one, it is time for Magento 2 Website Development. It is one of the ways to increase customer satisfaction.
Because a customer does not wait for more than 3 seconds, an online business owner has to be careful to serve product pages, landing pages, and possibly all site pages within just this much time.
For this reason, I have compiled this article to show you valuable tips and information that decrease page loading time, specifically for Magento stores.
I have tried to describe all tips in the simplest manner possible, but still, if you aren’t a tech person, you may have to put in a little more effort but it will save you from spending coins with a DIY approach as opposed to hiring Magento developers.
Let us not waste our time on less technical talks, we will take a fast-paced optimization.
Look at Magento 2 speed and performance optimization tips
Avoid poor performance of webshop
1. Host the Magento store on a dedicated server
Shared hosting is one where multiple websites are hosted on the same machine. High-traffic sites in this situation snatch away costly resources like CPU, memory, etc., and cause other websites on the same server to render slow webpages.
If your Google Analytics exhibit a sufficient number of visits every hour say at least 100+ Unbounce visitors average an hour, a dedicated server is pursuable.
2. Hosting country
Beneficial is choosing a hosting company that owns servers in the country where your target customers are.
3. Software Versions
For any or all types of software including Magento framework, Apache or another web server in place, database product version, etc., update them from time to time to get new features, better security, and performance.
If your web host manages web server products, ask to upgrade sooner than later or change vendors.
Crop unnecessary white spaces from images.
Use GIF, or PNG files instead of JPG.
Check the total size of all images on a web page through browser extensions like Firebug.
5. Make no room for unused extensions
Don’t get lazy in cleaning up.
Disable and remove Magento extensions that you installed previously but now are sure of no use.
After disabling all scrub extensions if the Magento store yet performs slowly, try to ask any PHP/Magento programmer to comment or delete modules that are good for nothing. Rather do it yourself.
6. Measure how many requests your website can take-up
Using Google Speed Tracker, Pingdom, etc. is good.
There is a more discreet tool: Apache Benchmark ( ab )
Take, for example, the following command that will test how fast yourwebsite.com can handle 100 requests.
Among these 100 requests, 10 are concurrent:
ab -n 100 -c 10 http://www.yourwebsite.com/
This is to be typed at the command line of the Apache Benchmark tool that you can install by entering the command
Sudo apt-get installs apache2-utils on Ubuntu Linux, for windows please download it from Apache Benchmark’s site.
Please go through related text on the web, this is just to show you a new way to measure performance.
7. Hardware considerations
Check website performance by increasing CPU or RAM or Disk(I/O) rate or all 3 together.
This is to say that set up the development environment of your Magento site in Oracle Virtual Box and issue the above ab command.
Then increase hardware inputs to the guest OS and check results again, if significant differences are seen, the bottleneck is not in the software. Adding more hardware resources, in this case, is beneficial.
8. Select a certified web hosting company for expert Magento installation
Magento Inc. maintains a country-wise list of hosting companies that provide proficient Magento installation on their server for free, you can consult any of them as the first-time setup plays a major role in the ongoing journey of a website.
To mention just a few, below are parameters to think of at Magento installation time:
- Amount of web space and I/O performances
- Virus scanner
- Data transfer (traffic/bandwidth)
- Root access FTP, PHP, Perl, SSI, .htaccess, SSH, MySQL, and crontabs
- SSL (secure server)
- E-mail, POP
- Control panel
- Multiple domain hosting and subdomains
- Web server and operating system
- Monthly/quarterly/annual payment plans
- Customer support 24 x 7
9. Use Content Delivery Network (CDN)
If your customer base is widely spread across multiple countries, and traffic to
site is high, CDN is a good solution in that situation.
CDN is a large distributed system of servers that are deployed globally and serves a copy of images, objects, and files from the closest to the customer server thereby dramatically decreasing response time.
10. Apply proper configurations on the web server of the Magento store
Out of the major web servers supported by the Magento platform, two are primarily utilized:
Nginx is not widely used and is a bit harder to integrate, hence we will go through tweaks of Apache alone.
To realize the advantages offered by web server tweaks mentioned herein, you can prop up ab tool explained above while not changing the hardware settings.
For Apache, how to leverage Magento speed optimization access :
After installing or in the pre-given available Apache web server, add below code snippets at end of the .htaccess file you see at the root level:
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0 no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html SetEnvIfNoCase
Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary Header append
Vary User-Agent env=!dont-vary
Also, add below more statements at end of the same .htaccess file and restart Apache.
Relaunch ab tool and server stress will have been reduced in MBs.
Although Apache covers nearly 45% stake of all web servers deployed on websites globally, Nginx fewer times outperforms it – from experience, we’ll unfortunately not look into it, please see related sources on the web.
This is perhaps the most powerful way if your Magento website is loading very slow
11. Tuning MySQL database engine & Leverage Caching
MySQL tuning Primer script is the file that comes to your rescue to do so.
Sometimes when all other tricks do not provide performance remunerations collaboratively, the final point to optimize the website is to tune the MySQL database engine.
To get recommendations for what should be adjusted in your setup, issue a tuning primer script at the operating system shell.
$ sudo chmod +x tuning-primer.sh
You may be asked for the root username and password before the script can complete successfully.
Once execution is over, make the necessary changes in my.cnf file which you get in the results of the above script.
You may even improvise by optimizing Magento database tables and by replicating MySQL database if your business is indeed a saturated traffic E-commerce store.
To implement both of these, It is recommended to hire a certified Magento developer who will do it for you as I believe the technicality of these tasks should be unaffordable for a non-IT business owner.
A cache is system software that stores computed data to serve future requests
There are several brands of cache mechanisms available in the market that offer different types of caching.
The most standard and safe way is to enable the cache option from within the Magento admin panel before installing any third-party software, from System | Cache Management, as given in the below screenshot.
Here, enable all including
- EAV types and attributes
- Collections Data
- Both the Web Services Configuration options
Amongst other caching systems, popularly used are Varnish, Alternative PHP Cache, and Memcached – subject to your wish and your production environment.
Apart from the above techniques, there also comes kinds of Magento speed optimization extensions which you need to check thoroughly before installing one.
- amount of good reviews
- number of installations until the date
- diversified client base
- version compatibility &
- launch date & price
are premier factors to assess before buying any extension.
I hope reading the above text has been fruitful for you and hasn’t been a waste of time.
Viha Digital Commerce Pvt. Ltd. (VDC) provides all types of support and full-cycle setup services to create lucrative Magento stores for any business.
If you are tired of too many variable prices offered by different Magento service providers and seeking a standard, Hire Dedicated Magento Developer and get a Free Trial For 8 Hours, call us at +91 7096620202
or drop the requirements file at firstname.lastname@example.org to get a free quote for your project.