XF 2.0 Are there any performance implications if you leave designer-mode enabled for a style?

It's not really recommended for production and it may have performance impact, as it requires checking a number of files for modification on each page view.
 
There is a performance overhead for anything involving designing or development, especially with the designer mode as it constantly watches the templates for changes.

It also enables debug mode which does things like query logging and we don't recommend setting that in production.

The way to do it safely if you have to is to only enable designer mode for specific IP addresses. That can be done by wrapping the config in an IP address check.
PHP:
if (!empty($_SERVER['REMOTE_ADDR']) && in_array($_SERVER['REMOTE_ADDR'], [
        '1.1.1.1',
]))
{
    $config['designer']['enabled'] = true;
}
 
Ok so it sounds like its pretty tightly coupled with debug mode.

The reason I asked is because we're trying to come up with a way to work on template files through an IDE, have them committed to source control and then deploy those files directly to our server, without having to run an additional database update step.

Is 'loading templates from filesystem with as little additional overhead as possible' a feature that might be supported in the future? Even if we had to have every template stored on the filesystem to skip the database check completely.
 
You can do what you want to do without having designer mode enabled for everyone.

It’s not too dissimilar to what we do here from a development perspective which uses a very similar system as designer mode.

Rather than enabling designer mode for a specific IP address, you could enable it only if accessed via the CLI:
PHP:
if (PHP_SAPI != 'cli')
{
    $config['designer']['enabled'] = true;
}
That means that no web users will have designer mode (or debug) enabled, but PHP scripts running from the CLI will have.

That means whenever you deploy those files, you will import those by running this command:
Code:
php cmd.php xf-designer:import <designer_mode_id>
 
Top Bottom