All about Magento application modes

Before we get into code, let’s talk about the different application modes available in Magento.

We’ll first head over to the Developer Documentation. If you don’t know about this yet, it is a great place to find information about a lot of things in Magento.

https://developer.adobe.com/commerce/docs/

Search for application modes, and go to this About application modes page.

There are 4 different modes in Magento: default, developer, production & maintenance. Let’s go over each one of these.

“default” is the out of the box application mode to allow you to easily run Magento. This mode is a bit of a Frankenstein mode though, in that it’s really not great for either development or production. It isn’t friendly for development because error’s aren’t displayed when they happen, and it also has poor performance on production. You’ll never really want to run this mode.

“developer” mode is where it’s at! This is the mode you’ll pretty much be in all the time. Errors are displayed to the console, generated code is automatically compiled, and it is the mode that was created & designed for development. You’ll never want to run this mode on production because it isn’t performant at all, and errors displaying in the browser is a potential security risk.

“production” mode is what you’ll always run on... you guessed it, production! This mode is extremely performant, but we can’t use this for development because errors aren’t displayed in the browser, caches can’t be explicitly controlled, and some configurations aren’t easily changeable. A big note about this mode is that generated code is not automatically compiled — it must be manually triggered within a deployment process. While this mode isn’t at all good for development, it runs perfectly on production and is the only mode you should run on production servers.

“maintenance” mode is the last mode available, and it’s the least interesting of the bunch. This just redirects users to a “Service Temporarily Unavailable” page and basically prevents visitors from accessing your site. This is only used on production servers during specific deployment or maintenance tasks.

If you wish to learn about these modes in more detail, feel free to read more about them in the DevDocs at About application modes.

Complete and Continue  
Extra lesson content locked
Enroll to access all lessons, source code & comments.
Enroll now to Unlock