Supercharging Your eCommerce Store with Magento 2 Cache

Technology is increasing the capability of smaller businesses to sell higher volumes online, but this can lead to one major problem – a slow website, and customers these days have zero patience

Forget waiting minutes for a site to load, most customers will only hang around online for several seconds before leaving your site and never coming back. A slow site means slow sales. That’s why it’s so important to have a good load speed! A speedy eCommerce store will help you rank better on search engine results, and customers will continue to buy online from you.

How Magento 2 Cache Differs

This is where Magento’s Cache kicks-in. When someone visits your eCommerce store Magento caches it, making subsequent requests super speedy. The release of Magento 2 in late 2015 supercharged the platform to offer 50% faster load times to make your customers happy and improve conversion rates.

We already have covered Magento caches in Anatomy of Magento Cache and Understanding Full Page Cache in Magento Enterprise but Magento 2 Cache differs a lot. Magento 2 is a brand new platform so it is faster, less resource-hungry, and better optimized for higher loads than Magento 1.X

Enterprise and Community Platforms

For Magento 1.x only Enterprise Edition had the Full Page Cache integration. Magento Community Edition was left out of this special feature. Merchants on Magento CE were required to us paid extensions to accomplish the same performance.

This changed with the release of Magento 2.0! The platform now offers a lot of new performance enhancements and features pre-integrated for both Community and Enterprise Editions. These features include: native support for Full Page Cache, Varnish, Redis, Nginx, Content Delivery Networks, CSS Compilation and RequireJS.

Magento is a database driven platform. That means it uses multiple queries to get data from database tables. This requires time to compile results. Using cache avoids subsequent server side requests and delivers web pages faster. Magento is equipped with following type of caches:

Cache Type Description
 Configuration Magento gathers configuration from all module/config.xml files, merges it, and saves the merged result to the configuration cache. This cache also contains website and store scope-specific settings stored in file system and database.
 Layout  Compiled page layouts (contains, layout.xml components from all components).
 Block HTML Output  HTML page fragments per block.
 Collections Data  Results of database queries. Magento cleans up this cache automatically, but third-party developers can put any data in any segment of the cache.
 DDL  Database schema. Flush this cache type after you make custom changes to the database schema.
 Entity attribute value (EAV)  Metadata related to EAV attributes (e.g. store labels, links to related PHP code, attribute rendering, search settings etc.).
 Page cache  Generated HTML pages. Flush this cache type after making code level changes that affect HTML output.
 Reflection  Removes a dependency between the Webapi module and the Customer module.
 Translations  Merged translations from all modules.
Integration configuration Compiled integrations.
 Integration API Configuration Compiled integration APIs.
 Web services configuration Web API structure.

Magento 2 Cache Management

ecommerce, website design, demac media, magento 2 cache, website cache, magento ecommerce, caching

ecommerce, website design, demac media, magento 2 cache, website cache, magento ecommerce, caching

Magento 2 Cache Management module is located under Admin Sidebar -> System -> Cache Management (Under Tools section) and can be used to Manage various types of caches. Along with buttons for clearing cache, this page also gives option to enable or disable, and to flush specific cache types.

ecommerce, website design, demac media, magento 2 cache, website cache, magento ecommerce, caching

This screen also shows status of each Cache Type and the one’s marked as “Invalidated” should be flushed to Generate newer cache.

ecommerce, website design, demac media, magento 2 cache, website cache, magento ecommerce, caching

Caches become invalidated when Magento detects a change in original and cached version of an entity. For example, when you change the HTML output of a page, you will receive a notification about invalidated cache in Admin with a link to the Cache Manager so you can refresh the Page Cache.
ecommerce, website design, demac media, magento 2 cache, website cache, magento ecommerce, caching

The purpose of Flush Magento Cache is to flush entire Magento Cache and regenerate it again on very first load.

ecommerce, website design, demac media, magento 2 cache, website cache, magento ecommerce, caching

Below the core cache types, we also have some additional Cache Management actions

  • Catalog Images Cache – Resized Product images are saved in this Cache; Flush Catalog Images Cache will remove all the catalog images that are stored in: media/catalog/product/cache directory. This can be flushed in case if recent images aren’t appearing in catalog, or to remove outdates images that are no longer used.
  • JavaScript/CSS Cache – This cache includes combined and minified JavaScript/CSS files. Flush JavaScript/CSS Cache can be used to remove the merged copies of JavaScript and CSS files or If JS or CSS change is not appearing on front-end.
  • Static Files Cache – All Static Files cache can be flushed from here

Improve your Performance with Magento 2’s Cache

ecommerce, website design, demac media, magento 2 cache, website cache, magento ecommerce, caching
As you can see, Caching is vital part of your website and should be enabled on Magento stores at all times for improved performance and ROI! I hope after reading this article you will find Magento 2 Cache Management a piece of cake.