Experience Super Fast Managed Hosting | Upto 2 Months FREE | Use Coupon Code: MGT25
AVAIL NOW

Things To Consider For Magento Optimization and Better Performance

Magento 2 is perhaps the most popular platform in the ecommerce industry today. Given the fact that this industry has popular names such as WooCommerce and Shopify, you can easily imagine the pull of Magento 2 over the users.

At the heart of the success of Magento 2’s success lies the tricky idea of Magento optimization. I have deliberately used that adjective simply because optimization is a tricky business. Anyone can set up a Magento 2 store but to make sure that it is up and running smoothly is a whole different matter altogether. Factor in a load of visitors and transactions, and you can have an idea of the importance of Magento optimization and its direct impact on the bottom-line dollar figures.

The Magento community is often divided on the idea of Magento 2 store optimization. there are developers and users who prefer the vanilla Magento 2 platform right out of the box. On the other hand, there are community members who are all for in-depth tinkering with the platform to customize the platform to their heart’s content.

To highlight this debate, here are some questions people have asked in Magento forums and groups:

Hi friends my client site (Magento) loading speed is very slow how i can increase its loading speed. Please give me suggestion to overcome this issue. 

And,

Is Magento usually so terribly slow? This is my first experience with it and the admin panel simply takes ages to load and save changes. It is a default installation with the test data. The server where it is hosted serves other non-Magento sites super fast. What is it about the PHP code that Magento uses that makes it so slow, and what can be done to fix it?

Source: Stackoverflow

You can find such queries and complaints from users in many Magento forums. However, here’s the thing that not everyone who uses Magento 2 knows:

Magento Isn’t Slow by Default

It is hard to believe, but that is the truth. Users who face the issue of Magento platform speed are unaware of the fundamentals of Magento optimization.

In addition, a contributing cause of low performance is the lack of server/hosting resources. The hosting solution that powers the Magento store is the key to the success of the online store. If the server resources are not adequate, the performance will suffer and this will adversely impact the revenues.

Finally, the quality of the installation is another related factor that is important in the performance of Magento optimization and store performance. In the worst cases, problems in accessing and using Magento admin panel are the result of issues in installation.

Tips for Improving Magento Speed Optimization

Magento optimization, store performance, and above all, increased store ROI is not an academic idea. Here is a collection of actionable tips that will help you with store level optimization and see a marked and measurable improvement in store performance and ROI.

Tip # 1: Update Magento Version

Magento regularly releases new updates, with every update adding to the platform’s optimization. Therefore, the first and the most basic tip for improving Magento optimization is to update to the latest version. Here is how you can easily update your Magento 2 store. If you are on Magento 1, check out this guide to updating Magento 1 version.

Tip # 2: Enable Magento Varnish Cache

For Magento optimization, the next tip, and a highly recommended Magento best practice is enabling the Magento cache.

Enable Magento 2 Varnish Cache

Click on System under the Advanced tab, expand the Full Page Cache section and change the Caching Application field to Varnish Caching.

Magento Optimization 1

Enable Magento 1 Full Page Cache

For Magento 1 Community Edition, you need to install the Full Page Cache extension.

Note: that this comes as a native feature of the Enterprise Edition.

Tip # 3: Configure Magento Memcached

Memcached is a free and open source distributed memory object caching system that improves Magento optimization by decreasing the load on the native database. Since the configuration process is a bit long, I have included the following links so that you can see the respective configuration process in detail:

Magento 2: Magento 2 Memcached Configuration.

Magento 1: Magento 1 Memcached Configuration.

Tip # 4: Enable Flat Categories and Products

Magento uses precious server resources for accessing the details of categories and products from the native database. As a result, the store starts to slow down due to the lack of resources.

To resolve this problem, enable Flat Catalog that would reduce the load on the database by creating a new table with all the necessary record of product and catalog is present.

For this:

Step 1) Go to the admin panel of your Magento store, and navigate to Store → Configuration.

Step 2) Click Catalog under the Catalog tab.

Step 3) Expand the Storefront section, and change the fields Use Flat Catalog Category and Use Flat Catalog Product to Yes.

Magento Optimization 2

Tip # 5: Optimize JavaScript and CSS

Unnecessary JavaScript and CSS decrease page load speed. So, if possible,  avoid JS and CSS files. Next, you can further optimize the necessary JS and CSS files through minimization. The process is simple:

Step 1) Click Developer under the Advanced tab.

Step 2) First, explore the Javascript Settings section, and change the fields Merge JavaScript Files, Enable JavaScript Bundling and Minify JavaScript Files to Yes.

Step 3) Explore the CSS Settings tab, and change the fields Merge CSS Files and Minify CSS Files to Yes.

Magento Optimization 3

You can also install the merge and minify extension to merge and minify CSS and JS files to automate the process.

Tip # 6: Enable Content Delivery Network (CDN)

A CDN is a global network of servers that simplifies and optimizes content delivery integrate website CDN into your Magento store is an easy way of improving page load speed and thus providing a greater user experience.

To set up a CDN with your store, follow these steps:

Step 1) Click Web under the General tab

Step 2) Depending upon your website protocol you will expand either Base URLs (for HTTP) or Base URLs secure (for HTTPS)

Step 3) Add your Zone URL or Zone Alias to the Base URL for Static View Files field followed by /static/. For example: www.magento-227698-780182.com/static/

Note: Make sure your Magento store is as per the docs, /pub/ is already what the webserver will serve out and that’ll break the site in a way that will take you to the mysql CLI prompt. However, if the above Base URLs are not working for you, try adding /pub/ to the URL like so: www.magento-227698-780182.com/pub/static/ and www.magento-227698-780182.com/pub/media/

Step 4) Add your Zone URL or Zone Alias to the Base URL for User Media Files followed by /media/. For example: www.magento-227698-780182.com/media/

Magento Optimization 4

General Suggestions For Improving Magento Performance

The following are version independent suggestions (except for one) that you can apply to your store and see an immediate increase in the store handling and response at both the frontend and backend.  

Use Lightweight Theme

Always use a lightweight theme with minimum bells and whistles. These themes directly affect store-level Magento optimization because of their small size. With less data to deal with, the load time decreases, resulting in faster response times for your store.

Bug-Free Extensions

Always opt for bug-free third-party extensions for your Magento stores. This is a simple way of avoiding configuration and optimization related issues. Always buy extensions from reputable development agencies and that too after reading a couple of reviews.

Fully Optimized Images

A Magento store generally has a ton of high-resolution images. While these are good for business, the huge file size increases the overall page size, with a proportional negative impact on the download time. Thus, optimizing and reducing image size is an essential aspect of the overall store-level Magento optimization. The key points in optimizing the images are:

  • Compress the images (use a tool to batch-compress the images).
  • The logo of your store should be in PNG or SVG format.
  • Product images should be in JPEG format.

Enable Magento 1 Compilation

The Magento 1 compiler reduces the load time by copying all necessary files into a single include directory and caching the most frequently used files for quick access. These two steps reduce the general page load time.

Clean Up Magento Database & Logs

By default, Magento keeps the logs for 180 days. For an average store, this could result in a huge data volume that quickly overloads the database. You can set up Magento to maintain logs for a shorter duration and reduce clutter in the database.

Magento Server and System Requirements

Magento Server and System requirements are the most important factors in Magento speed optimization for better performance of your stores.

Server Requirements

Unlike other ecommerce platforms, Magento is a resource-intensive platform that demands a decent web hosting solution such as a Cloud hosting or VPS hosting.

Tip: Avoid shared hosting for Magento stores because ecommerce stores require a huge volume of server resources for sustained function. A shared hosting solution can’t provide this level of resources with consequent impact on store performance.

System Requirement for Magento 2 Optimization

Operating SystemLinux distributions such as RedHat Enterprise Linux (RHEL), CentOS, Ubuntu, Debian.
ComposerComposer is an essential requirement for developing Magento extensions or contributing to the Magento 2 codebase. I highly recommend using the latest stable version.
Database
  • MariaDB and Percona
  • MySQL 5.6, 5.7
PHPMagento 2.0

  • 7.0.2
  • 7.0.6–7.0.x,
  • 5.6.x
  • 5.5.22–5.5.x

Magento 2.1

  • 7.0.2
  • 7.0.4
  • 7.0.6–7.0.x
  • 5.6.5–5.6.x

Magento 2.2

  • 7.0.13–7.0.x
  • 7.1.x

Magento 2.3

  • 7.1.3-7.0.x
  • 7.2.x
Required PHP extensions
  • bc-math
  • curl
  • gd, ImageMagick 6.3.7 (or later) or both
  • intl
  • mbstring
  • mcrypt
  • mhash
  • openssl
  • PDO/MySQL
  • SimpleXML
  • soap
  • xml
  • xsl
  • zip

PHP 7 only:

  • json
  • Iconv
Mail serverMail Transfer Agent (MTA) or an SMTP server.
RedisVersion 3.0 for page caching and session storage (the latter supported by Magento version 2.0.6 and later only)
Magento VarnishVersion 3.5 or latest stable 4.x version for page caching
MemcachedLatest stable version for session storage with either memcache or memcached PHP extensions (latest stable version)

These are the basic requirements mentioned in the Magento DevDocs. If you need further details, check out the following links:

For Magento 2.0.x: Magento 2.0.x technology stack requirements.

For Magento 2.1.x: Magento 2.1.x technology stack requirements.

For Magento 2.2.x: Magento 2.2.x technology stack requirements.

For Magento 2.3.x: Magento 2.3.x technology stack requirements.

System Requirements for Magento 1 Optimization

EnvironmentLAMP (Linux, Apache, MySQL, and PHP) or LNMP stack
Operating SystemLinux x 86, x86-64
ComposerComposer is a requirement for developing Magento extensions and contributing to the Magento codebase. It is highly recommended to use the latest stable version.
Database
  • MySQL 5.6 (Oracle or Percona)
PHP
  • PHP 5.6
  • PHP 5.5
  • PHP 5.4
Required PHP extensions
  • PDO_MySQL
  • SimpleXML
  • Mcrypt
  • Hash
  • GD
  • DOM
  • Iconv
  • Curl
  • SOAP (for Webservices API)
Mail serverMail Transfer Agent (MTA) or an SMTP server.
RedisThe preceding Magento editions support Redis server version 2.6.9 and later available version
MemcachedLatest stable version for session storage with either Memcache or Memcached PHP extensions (latest stable version)

 

Magento 2 Server Requirement

Web Server
  • Apache 2.2 or 2.4
  • In addition, the apache mod_rewrite module must be enabled. mod_rewrite enables the server to perform URL rewriting.
  • NGINX 1.8 or later.
RAM2 GB (Recommended)
SSHMust have SSH access to the server
SSLA valid security certificate is required for HTTPS.

 

Magento 1 Server Requirement

Web Server
  • Apache 2.x
  • NGINX 1.7.x
RAM1 GB (Recommended)
SSHMust have SSH access to the server
SSLA valid security certificate is required for HTTPS.

Are You Looking for a Better Solution?

Maintaining your Magento server could be hectic, and requires full-time resources and a decent budget to keep the ball rolling. So, is there a better and faster solution available in the market?

Yes, there is a managed Magento hosting solution that is optimized for Magento ecommerce stores. It comes with a performance-focused stack with NGINX, and PHP-FPM for improved page load time. It also comes with industry-leading features such as FREE SSL, CDN, and built-in Magento cache for lightning-fast Magento optimization.

Are Server Issues Affecting Your Magento Ecommerce Store?

With managed cloud hosting, you don’t have to worry about server and store optimization issues anymore.

 

Wrapping Up

The above-mentioned tips and suggestions will give your Magento store the performance boost it requires for grabbing a higher market share. The store will be able to offer much-improved user experience and result in higher customer satisfaction. As a result, your business will see significant growth in terms of revenues and market traction.

For any questions or queries regarding Magento optimization, use the comments section below.

About Author

Syed Muneeb Ul Hasan is an expert in PHP and Magento, he prefers to educate users in implementing and learning Magento. When not working, he loves to watch cricket.