Radoslaw Kozlowski about Sitecore

Sunday, 29 November 2015

Keeping
your Sitecore configuration files clean is very important thing for further
upgrades and maintenance. I had a lot experience with projects where
configuration files was edited and maintained poorly. This article will provide
you with some points you should observe to keep your Sitecore configuration
clean and transparent.

1)You
should definitely avoid editing Web.config file. Rather than that you should
use Sitecore patch files mechanism to change Sitecore configuration. In this
mechanism, Sitecore processes all .config files in App_Config\Include directory
and applies patches to Web.config file.

E.g when you want to replace pipeline processor
with your custom one, you could simply edit Web.config. You could delete or
comment line with processor you want to replace and write new one. This is the
fastest way but the worst. The best way is to create custom patch file:

2)Group
Sitecore patches into files that matches specified type of Sitecore region e.g
pipelines, scheduling tasks, events. Also make sure that your patches are
loaded last – put them in your folder in App_Config\Include
and name it with prefix ‘Z_’.