Magento 2.0 Performance Boost

Magento 2.0 Performance Boost Explained For Non Developers

Faster User Experience: Magento 2.0 offers faster page loading and browsing overall on the browsing side. Following techniques achieve this faster performance.

1. Web Page Compression
Web page compression is achieved by optimizing all the components of a web page displayed on user’s browser using various compression engines on the server side.
A web page is comprised of four elements: HTML code with textual content, Javascript, CSS, and images. Magento 2.0 reduces the total weight of the HTML page on the server by applying various compression engines in each of these four elements before serving the page to a client browser. The compression engines used for each of the elements

  • HTML + Textual Content is compressed using a custom compression engine
  • Images are compressed by PHP GD2 image compression library.
  • CSS (Cascading Style Sheets) are compressed using Austin.
  • jShrink is used to compress all Javascript/Jquery embedded within a web page.

2. Full Page Caching
Magento 2.0 employs web page caching on the server to store frequently used items in the server memory so that the server does not have to read it from the hard drive or database for every request and thus improving the page rendering time to the browser. By default, Magento uses smart web page caching using an open source cache software, Varnish. Magento 2.0’s page caching is smart enough to separate dynamic contents (customer data, order/cart data, etc..) from static contents( images, product data, etc..) and cache only the static data but combine the dynamic and static data together in the right order and serve to the browser. For enterprise-scale Magento installation with high demand, Varnish can also be deployed on to its servers for even further scalability and performance.
In Magento 2.0, Full Page caching is on for CMS (Content Management Pages), Category Pages, Product Pages and Error Message pages and same is off for Account pages (login, create an account, address book, wishlist), Cart page, Checkout page and Checkout success page. However the some of the pages in the latter category, private content, can be cached by the browser cache as explained below.

3. Browser caching
Browser Caching is the method by the browser to make sure that only the absolute necessary part of the web page is retrieved from the server only when necessary, improving the subsequent page load time on the browser and reducing the load on the server. In Magento 2.0, optimized web page components are cached by the client browser intelligently during the initial load to improve the speed in subsequent page loads. The intelligent caching works this way. Javascript and CSS are cached in the initial page load along with other static content and page begins to be displayed using these cached content. While the available content is being rendered,
private/dynamic data are being fetched from the server and displayed, giving a much faster user experience. From a user experience perspective, pages begin to load immediately without staring at blank pages.
Additionally, Magento 2.0 can retrieve all private data (username, items in cart ..) in one Ajax or Javascript call from the server instead of having to make the call for one piece at a time.

4. Asynchronous Operations
Synchronous calls and operations make the user wait till that operation is complete. Whereas asynchronous operations allow the user to continue with other tasks on the page while a task is already running. For example, during the checkout process, a user is allowed to fill out all parts of the order checkout page while address validation is routine is called. User does not have to wait till the address verification to complete so that he/she can fill the rest of the form. Magento 2.0 has multiple built-in asynchronous operations mainly in the order page, cart page and check out page. These asynchronous operations also allows CSRs (Customer Service Reps) or administrators to do back-end operations such processing phone orders, or pick and ship orders or updating product descriptions without causing process interruptions to other parts of the eCommerce site. This feature becomes very important for enterprise-scale Magento sites with large number of SKUs or many admins/CSR processing the orders/products on the back end.

By combining browser caching and web page compression techniques Magento 2.0 serves up near instant catalog browsing experience and reduced response time for order page and check out page resulting not only faster page loading time but also lowering cart abandonment rates.

5. Job Queues [Enterprise Edition Only]
This is one of the features that exist in the Enterprise edition to bring additional scalability and faster responsiveness. Using a job queue server, RabbitMQ, different tasks are put in multiple queues and picked up and executed as the server becomes available. The queue workers (not humans, but the applications meant for processing the tasks in a queue) can be run from separate servers to achieve further optimization. Some of the scenarios that can benefit from Job Queue mechanism are deferred inventory level updates, asynchronous order insertion, sending emails and database indexing, Magento 2.0 is planning to introduce more tasks compatible with job queues in future releases.

6. Improvements to PHP
Magento is written in open source programming language PHP. Even though Magento 2.0 can be deployed in older versions of PHP, using the latest version of PHP 7 framework gives Magento 2.0 an additional performance boost.

7.  Segregated Database Masters [Enterprise Edition Only]
To further isolate processes to gain additional processing speed, Magento 2.0 enterprise edition allows to divide the back end database into three databases representing three business entities: Product Data, Orders, Check out. Using this mechanism, all database operations (Select, Insert, Update, Delete) of these three business entities can be distributed across these three databases efficiently improving the processing time. Additionally, each master database can have its own slave databases to support select/read operations to realize an additional increase in speed.
These mechanisms ensure that check out processes in an e-commerce store do not stall the product browsing or adding an item to the cart.

Leave a Reply

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