Magento 2 Application Modes

This entry is part 2 of 5 in the series Magento 2 Series: Understanding the Architecture

There are 3 modes of Magento application, i.e. default (which is the default mode after install), developer, and production.

Here is the difference between them:

  1. default:

    • Not optimized for production
    • Symlinks to static view files are published to the pub/static directory
    • Errors and exceptions are not shown to the user, as they are logged to the filesystem
    • This is the default mode after install, use it if you only want to view and explore Magento. You should avoid using it in development or production environment.
  2. developer
    • Symlinks to static view files are published to the pub/static directory
    • provides verbose logging
    • Enables automatic code compilation
    • Enables enhance debugging
    • Slowest performance
  3. production
    • Errors and exception are not shown to the user, as they are logged to the filesystem
    • Static view files are not materialized, as they are served from the cache only
    • Automatic code file compilation is disabled, as new or updated files are not written to the filesystem
    • Enabling and disabling the cache types is not possible from Magento admin
    • Fastest performance

To set Magento application mode from command line, use this command:

php bin/magento deploy:mode:set:{mode}

change {mode} to default, developer or production.

 

and to view current application mode, use this command:

php bin/magento deploy:mode:show

or you can view it directly in array inside file app/etc/env.php, in field ‘MAGE_MODE‘.

 


During development, carefully balancing developer mode with some of the cache types being enabled/disabled can provide optimal performance

Series Navigation<< Magento 2 Architecture LayersMagento 2 Areas >>

Leave a Reply