From b0f4d0e16b7be3638a5471fd5292aca5973cdc2f Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 21 Jun 2017 18:11:03 +1000 Subject: [PATCH] U4-10046 Stop resolving TreeController from the PluginManager for every back office request --- src/Umbraco.Web/Editors/BackOfficeController.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web/Editors/BackOfficeController.cs b/src/Umbraco.Web/Editors/BackOfficeController.cs index a72b9ac85e..438a9f179c 100644 --- a/src/Umbraco.Web/Editors/BackOfficeController.cs +++ b/src/Umbraco.Web/Editors/BackOfficeController.cs @@ -717,11 +717,19 @@ namespace Umbraco.Web.Editors return app; } - + + /// + /// A lazy reference to all tree controller types + /// + /// + /// We are doing this because if we constantly resolve the tree controller types from the PluginManager it will re-scan and also re-log that + /// it's resolving which is unecessary and annoying. + /// + private static readonly Lazy> TreeControllerTypes = new Lazy>(() => PluginManager.Current.ResolveAttributedTreeControllers().ToArray()); private IEnumerable> GetTreePluginsMetaData() { - var treeTypes = PluginManager.Current.ResolveAttributedTreeControllers(); + var treeTypes = TreeControllerTypes.Value; //get all plugin trees with their attributes var treesWithAttributes = treeTypes.Select(x => new {