Managing Magento 2 set mode (MAGE_MODE)

Magento 2 comes with a new feature set called MAGE_MODE. This option gives you the configuration to run Magento in either developer, default, or production mode.

This feature is very important during development and product phases. It gives a developer the tool to debug or created optimized caches for high performance needs.

By default, the default mode is set.

The following table describes the modes in which we can run Magento:

Mode name

Description

default

When no given mode is given, this is explicitly set and has the following benefits:

  • Static view file caching is enabled
  • Enables automatic code compilation (code optimization)
  • Exceptions are written to the log files.
  • Hides the custom X-Magento-* HTTP response ...

Get Magento 2 - Build World-Class online stores now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.