In this case of building up some caching on Sitecore application start, I create a new config include file and add the my new processor:
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <pipelines> <initialize> <processor type="MyExtensions.Pipelines.Caching.CachePrefill, MyExtensions" xdt:Transform="Insert" /> </initialize> </pipelines> </Sitecore> </configuration>
Do the coding. Notice, you don’t need to inherit from any other namespaces.
namespace MyExtensions.Pipelines.Caching { public class CachePrefill { public void Process(PipelineArgs args) { Sitecore.Diagnostic.Log.Info("MyExtensions: Running CachePrefill.Process method", this); //do my magic cachePrefill(); Sitecore.Diagnostic.Log.Info("MyExtensions: Done running CachePrefill.Process method", this); } } }
Nothing more, nothing less.
No comments:
Post a Comment