Have you got a business-objective?

We have a solution.

Get a consultation right now!

contact us

request a quote
Enter your name
Your contact number
Enter your message
Natalya Brinza Project Manager
artjoker blog your guide for reaching success
in the online-business

What We Should Know About Magento 2: Out-of-the-box Features, Extensions, Tips

Every entrepreneur or owner of an online store knows that the key to every e-commerce project's success is its good performance. Fast and well-performing website not only gets a good ranking in search engines but also a high appreciation by users for its handiness. This helps turn visitors into buyers and in such a way increase sales. No one doubts the excellent Magento 2 performance, but there is still something worth to be figured out and improved in the case of the platform.

It doesn't matter if you know a lot about Magento 1.x productivity – the second version differs much by another approach. For examples, Magento 2 is faster, less resource-hungry, and better optimized for high loads. Also, it offers many performance features (native support for Varnish, Redis, Nginx, and full-page caching) that in the first version were only available through customizations and extensions. However, there is still a lot of work to be done to perfect site's running speed.

Full Nginx Support

There are three things Nginx was developed for: better performance, high concurrency, and low usage of memory. The mechanism of increasing the speed is that Nginx utilizes an event-driven asynchronous approach. Because of this, Nginx shows more predictable performance even under higher loads. Because of the native Nginx support, you can easily install it on the top of the platform.

Redis

This value cache provides top-notch performance and offers these features: pushing an element to a list, value incrementation in a hash, getting a sorted set of members with the highest ranking, appending to a string, and set intersection, union and difference computing.

The reason for high-performance results is due to incorporating several use cases for in-memory datasets. You can carry it on by dumping the dataset to the disk or append each command to a log. Also, if you need a multifunctional and in-memory cache, the steadfastness can be disabled.

Redis provides non-blocking synchronization and auto-reconnection with resynchronization partial on the net split. These features make Magento 2 a fast solution for every e-commerce site.

Cache Types available for Magento 2:

  • Configuration cache is gathering from modules and includes store-specific settings from the database and the file system.
  • Layout cache is gathering from compiled page layouts
  • Block HTML output cache includes HTML page fragments per block
  • Collections data cache includes database queries
  • DDL cache works with database schema
  • Entity attribute value cache is for Metadata related to EAV attributes
  • Page cache is for data about generated HTML pages
  • Translations cache includes merged translations from modules
  • Integration configuration cache is related to compiled integrations
  • Integration API configuration cache is compiling integration APIs
  • Web services configuration cache is the one of a web API structure

Find configurations and settings you've read before under System => Cache Management.

About Magento 2

Full Page Cache

This type of caching stores the full page output. As a result, next page loads do not require much server load. This feature is necessary for high-traffic websites to keep server load as low as possible – it helps to avoid downtime even when the traffic is very high. Also, it helps increase the site's speed because the server needs will be reduced to fetching and rendering pages from the cache.

Magento can clean up a cache automatically, but you can still put data in any cache segment manually. After modifying any code that affects HTML output you should clean FPC. Keep the cache enabled to have the performance of your project always improved.

Varnish Cache

This HTTP accelerator serves to heavily consumed APIs and websites with a lot of content. Because it is an out-of-the-box solution for Magento 2, it is easily configured for any e-commerce project to increase its performance.

How does it perform? Varnish receives requests instead of a web server, looks at what is being sent, and then sends back a request to your web server that sends another response to Varnish to finally pass it to the client. Seems too long? The fact is that Varnish stores responses from the back end in its cache. That is why it rapidly serves further repeated responses using in-memory cache storage.

CSS Preprocessing

Because CSS has a powerful syntax, while working on non-trivial it grows to enormous sizes. Luckily, there are SASS and LESS – CSS preprocessors. For Magento 2, it is better to focus on LESS. It has such core features as nested syntax, ability to define variables and mixins, multiple files joining and a variety of operational and mathematical functions.

CSS and JS minification

These Magento 2 procedures are similar to Magento 1.x ones. Combining, compressing and caching Javascript/CSS files improves the performance of a website that was built on Magento 2 platform.

Catalog images caching

Magento generates cropped product images in different sizes to reduce its loading time on a page. The cache is generated during the first image upload and can be easily removed manually.

Code Generation

You can improve Magento 2 performance by adding unique features to the default setup. You are able to bring aspect-oriented programming, generic programming, and other complicated techniques to languages that aren't supported by default. But such performance may slow down the system, so you should utilize the command line to force the system to inspect the code and generate necessary classes.

RequireJS for Improved JS Performance

This tool is optimized for both JS environments and in-browser use. It is used to improve the quality of code and the speed of apps. The tool plays a key role if you want to improve JS development – it specifies dependencies between JS files and loads them into a browser. This can perfect website's performance in a great way.

Session Storage Management

Also, you can perform improvements in another way – by moving from files to the database or Redis. To do this, you should use the -session-save option with:

  • db – to move to the database. If it is a clustered database – choose database storage
  • redis – to move it the Redis backend
  • files – to store session data in the file system

Our recommendations are to store everything in Redis because Magento 2 fully supports it, and you can easily prevent a store from its performance degradation. Redis is a reliable option to save database and file system from a dramatic decrease in productivity, the result of what can be a terrible user experience.

Out-of-the-box CDN Support

By providing CDN support there is an option to load media and static content from separate subdomains located on different servers of CDN networks. You can configure it under Stores => Configuration => Web.

PHP 7

Magento 2 will fully support PHP 7, a language with completely new performance and tons of new features and improvements. It is going to be much faster than the available PHP 5.x. The prediction is that PHP 7 will change our understanding of how fast an e-commerce site really should be.

General Server Side Improvements

What are the common performance optimizations?

Opcache – a code caching module that is specifically designed for improving the PHP part of the Magento performance. To store precompiled script bytecode it is used as a shared memory. Keep in mind that when optimizing Opcache settings, you are improving the performance of the Magento 2 website.

The proper configuration of MySQL and its alternatives is one of the most important enhancements to the performance of Magento 2. But there are some requirements for you: understanding of the hardware, knowing what settings to use. Also, there are two reliable substitutes: MariaDB and Percona.

New Relic – is a monitoring tool specially developed for identifying the problem of slow performance. which is a good reason to leave a web page in a few seconds.

You've just read thesis guide to Magento 2 performance. We are going to update it as soon as possible, so keep following us. If you have any thoughts about Magento 2, leave a comment or mail us to be heard.

Download the book by Artjoker for free, level up your web store!
Enter your name
Enter your email
Thank you! The book has been sent on your e-mail. Have a good reading.
Subscribe and receive regularly your portion of useful articles for internet-business development!
Enter your name
E-mail

More than 15 500 people have already subscribed!