So, you’ve built a store on Magento 2 and looking forwards to making thousands of sales every month. The superlative features and functionalities brought to you by Magento 2 make it an awesome selection in terms of e-commerce website platforms. However, what if there’s a surprise for you? What if your e-store’s pages take too long to load?

With the cutthroat competition in ecommerce, it’s just not affordable for e-retailers to have customer attrition because of issues such as the page taking too long to load. Your customers always more than a couple of alternatives in mind when they give a chance to your e-store by a product search.

A Radware research highlighted some statistics worth knowing:

  • A website with page loading speed of 3 seconds gets 22% fewer views than one with page loading speed of 1 second.
  • In a similar comparison, slow loading websites suffered from 50% higher bounce rate, and recorded 22% fewer conversions, as compared to faster loading websites.

1 or 2 seconds – that’s the kind of page loading speeds you want. Thankfully, web hosts are able to power up such requirements for websites. Just that sometimes, there are uncontrollable factors at play. Of course, you can’t do anything if the user’s Internet connection is not good enough. However, it could well be a result of settings and other related aspects of Magento 2. Thankfully, you can tweak some settings and change a few things to improve page loading speeds for your websites on Magento 2; read on to find out.

Check The Web Server’s Resourcing Power and Configuration

Your web hosting service will have a significant role to play in determining how fast your Magento 2 web stores’ pages load. Several businessmen and entrepreneurs invest in dedicated hosting services for their e-stores, so that they never have to compromise on website speed. Another equally good option is to go for VPS solutions. It’s best not to go for shared web hosting, because invariably, your website does not get the resources it needs to load as quickly as possible. Apart from these basic suggestions, make sure you follow the cardinal rule – check the web server’s configuration and resource specifications and make sure it meets Magento 2’s minimum requirements.

  • Operating Systems: Debian, CentOS, Ubuntu, Linux x86-84, RHEL
  • Composer: You’d need the latest Composer version to contribute codes to Magento 2, and to develop new and edit recent Magento extensions.
  • Web servers: Apache 2.4
  • Database: MySQL 5.6
  • PHP: 7.0.2 (only Magento 2.0.1 and later versions support this)

Apart from this, note that Magento 2.0 can use technologies like Redis version 3.0 (meant for page caching), Varnish 3.5 (again, for page caching), Apache Sol4 4x, and RabbitMQ 3.5. These settings are just a few of the major ones; we strongly recommend that you check out the complete system requirements laid out on Magento 2 website.

Cleaning Logs in Magento Database

Wondering whether or not you require optimization for your Magento database? Well, you might be surprised how often this activity brings page load speed improvements for Magento 2 e-store owners. A thumb rule to remember is – if you see more than 200 MB, go for a cleanup.

Now, database cleaning is not exactly a bed of roses. That’s because you will need to back up the entire data, and only then go about cleaning the database log. Any unintentional data deletions can be a lot of trouble so make sure you perform this activity with the support of an expert. Magento Admin gives you an option of Log Cleaning – that’s pretty useful. Another option is to do it manually using phpMyAdmin. Then, you can also use MySQL client to clean the database log.

Adopt Strong Image Optimization Practices

Images are the life and soul of all the product pages on your Magento 2 web store; of course, you can’t compromise on the number of images you upload, However, by optimizing already uploaded images, and adopting some smart practices going forward, you can drastically reduce page load lags because of the visual-heavy nature of the content.

For starters, make sure you compress your images before uploading them to Magento. You can use an image compressor on your desktop to reduce image file sizes before uploading or can use or more of Magento’s terrific image optimization add-ons for the same purpose. Also, make sure you don’t upload copies of the same image, purely because you need to upload a complete image set for a new product page.

Over the long run, this avoids pile up of duplicate images on the database. Another good practice is to use PNG and SVG image file formats only for brand logos, new product landing pages, promotional offer pages, etc.; use JPG format for routine images.

Use Flat Catalog Category

Administrators and owners of large ecommerce stores powered by Magento 2 often report page load lags. The reason behind this is the reduction in read speeds of the database. One way to improve the read speed is to organize the structure of the Magento 2 based e-store by enabling flat categories and products. This reduces the number of database table joins to show products. Subsequently, this practice reduces the complexity of the MySQL query and improves the performance of the website. Remember, if your e-store has a lot of products, it makes sense to enable flat categories. You can do this by going to backend settings, where you can select ‘Catalog option from the ‘Configuration’ header. For the option ‘Use Flat Catalog Category’, mark ‘yes’, and you’re done.

Use Full Page Caching

Full page caching keeps a majority of the page data in the cache memory. Because cache memory is enabled for fast reading, the page is loaded on the user’s screen almost instantly. Now, for ecommerce websites based on Magento 2, this is of the utmost importance.

We’ve already mentioned how even a single extra second in page loading can create major troubles for the web store in terms of low conversions and high bounce rates. This makes full page caching a pretty useful feature for anybody managing a Magento 2 based ecommerce website.

Using full page caching makes sure that servers are not overloaded at the time of peak traffic. Also, it goes a long way in preventing downtime during peak traffic. Because content assets of your website’s pages are fetched from the cache memory, the performance of the website on the whole improves.

Leverage the Power of Content Delivery Networks

Content Delivery Networks have brought in tremendous benefits for a heavy ecommerce website, particularly those with a geographically spread audience. A content delivery network (CDN) is a system of interconnected and distributed web servers. Your web pages are delivered to the audiences via a web server that’s most closely located to their geographical location.

Now, because of the reduction of the geographical distance between the point of data and the point where the request is made, web pages load faster when you use CDN. There are several CDN service providers with servers spread across the globe. To make the most, look for a CDN service that offers maximum relevant geographical coverage for your audiences.

Magento 2 supports CDN out of the box; just go to Stores settings, choose General, and go to Configuration. Here, go to Web, and then Base URLs. Here, you can key in your HTTPS CDN URLs and begin leveraging the power of CDN for your website

Optimize your CSS and JS Files

Agreed, your e-store based on Magento 2 needs a super impressive storefront design. However, note that this has an adverse impact on your website’s loading speed. Magento 2, however, gives you a practical method that lets you merge CSS and JS files to give a speed boost to the website. To do this, go to Backend and then select Configuration (from Stores icon). Then, open Developers tab from Advanced header, and change the JavaScript settings for ‘Merge Javascript Files’ to Yes. Also, select the option to Minify JavaScript files. In a similar manner, you will need to make these settings changes for CSS files.

Bonus Tip: Code Generation

Did you know that code generation brings in generic programming, object oriented programming, and aspect oriented programming prowess to the languages that don’t ordinarily support them? By setting off code generation, you can give a tremendous boost to your Magento website’s performance. This also lets you add unique features to the default Magento 2 setup. Consider using a command line to achieve this in Magento 2. You can use command “magento setup:di:compile” to generate the necessary classes and give a speed boost to the website.

Final Words

There you have it – the lowdown on what could cause speed issues with Magento 2, one of the most powerful ecommerce platforms, and the possible solutions to the issues. Also, we’ve covered the technical aspects of the configuration changes you can make to improve the speed of your Magento 2 based website. Experiment with a few of these, and make sure your website loads quickly.