Ecommerce Blog - The #1 Source for Ecommerce News, Tips and Trends!

Get ecommerce updates, news, and insider tips from the experts at PrestaShop!

Ecommerce Blog - The #1 Source for Ecommerce News, Tips and Trends!
 

< Back to the Blog home

5 Must-Know Rules before Putting Your Store into Production

Did you know that there are several options in your Back-Office that actually should NOT be enabled for your Live store? In most cases, before putting a store into production, you will go through a stage of development. During this development stage, you freely change whatever you need in order to improve your customers’ experience while reviewing stability and performance issues.

Whether your store is installed on your own desktop, on a dedicated development server, or directly at its final location, it has development options that should not be enabled in production.

If configured incorrectly, these options will not only significantly degrade performance, but it may also display information that should not be disclosed to the customers.

These options are for development purposes and are not meant to be enabled on a live production store.

With PrestaShop 1.5 we centralized a great part of these options in the Advanced Parameters > Performance tab so that you can easily turn them on and off. But the most technical options are only accessible through PrestaShop configuration files. Let’s go over these Back-Office options and configuration files to ensure an optimized PrestaShop store.

Overview:

 1. Compilation of Smarty template files

When you are developing the template of your store, Smarty needs to recompile the template for each call so that your modifications appear. In order to activate this option, choose the “Recompile templates if the files have been updated” or “Force compilation” option.

In production, just do the opposite! Compiling Smarty files is very slow, so you need to specify at the very least “Recompile templates if the files have been updated” but the most appropriate option is “Never recompile template files” because Smarty does not have to check the modification date of the file every time.

The downside is that you have to manually delete the compilation files if you then make changes to your templates. Overall, if you are not doing development on your template, you should have “Never recompile template files”

 2. Smarty Cache

Smarty cache is a really powerful ally to save server resources and improve performance. When the cache system is activated, instead of retrieving mass amounts of data from the database and processing them for each call, PrestaShop simply reuses the HTML block already generated for the first call and displays it immediately.

Of course, this option should be disabled when you want to alter your template in order to ensure that your changes are reflected immediately in the front office. However, in production mode, it is highly recommended to turn on this option to significantly improve the performance of your store (and even more with the 1.5.5 that will be released soon).

 3. Debug console

This tool is useful for some developers because it enable to display in a pop-up the data that have been assigned to the Front Office.

However, it is strongly recommended to keep this option disabled because it may contain private information concerning your catalog.

Since you can display those data with the debug console, its use must be turned off from production by choosing the option “Do not open console” – which is the default option in PrestaShop.

In version 1.4 though, this option was not available in the Back Office, you need to modify configuration file directly in /config/smarty.config.inc.php around the 40th line, replace

$smarty->debugging_ctrl = ‘URL’; /* ‘NONE’ on production */

by

$smarty->debugging_ctrl = ‘NONE’; /* ‘NONE’ on production */

The default option in PrestaShop 1.4 is to display the debug console with a parameter in the URL. Therefore you should check your configuration and fix it if needed.

 4. Developer mode

PrestaShop implements a Developer mode which includes error display and debug information about those errors on the Front-Office. This tool is totally essential for a developer, but must be avoided for a live store. Clearly, no store owner would want to display errors to the customers! When we create a new release ZIP file of PrestaShop, we turn off this option. If you want, you can modify the configuration file directly in /config/defines.inc.php in order to toggle the option, search for the line

define(‘_PS_MODE_DEV_’, false);

false means that the developer mode is disabled. In order to enable it (which should only be done on a development store), you must change this line to

define(‘_PS_MODE_DEV_’, true);

 5. Profiling mode

Much like the developer mode, PrestaShop implements a profiling mode: if you think that your store is unusually slow, enabling Profiling mode helps to understand the cause by adding important technical information in the footer.

Needless to say, this mode should not be enabled in production.

This option is disabled by default in PrestaShop and is also located in /config/defines.inc.php, search for the line

define(‘_PS_DEBUG_PROFILING_’, false);

false means that the profiling mode is disabled. In order to enable it (which should only be done on a development store), you must write

define(‘_PS_DEBUG_PROFILING_’, true);

Please check your configuration against the following table

If you want more information about the configuration settings of PrestaShop for development and production, please refer to the system administrator guide on our official documentation website.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>