Published on

How PreCompiled templates work

Authors

I asked support how precompiled templates work, and how we could implement them ourselves (site with slow load time)

This was the response…some great info in here from the gurus

Each of our ASP.Net controls has a template, which has a virtual path. When a request comes for a page that contains this control, we resolve the virtual path and we try to load the control from the Telerik.Sitefinity.PrecompiledTemplates assembly (this is much faster than letting asp.net compile the control ). The assembly was made using the asp.net compiler tool and asp.net merge tool against the final build version of Sitefinity. You can read more about web site precompilation / packaging here . If the requested template is not present in the assembly, we fetch the template from the database, check if it is different from the original and only then do we use the asp.net framework to compile the control given its virtual path – you can look at the System.Web.Compilation namespace and more precisely the System.Web.Compilation.BuildManager class -> CreateInstanceFromVirtualPath method.