Skip to content
This repository has been archived by the owner on Sep 29, 2020. It is now read-only.

Need to cache call to PluginManager.Current.ResolveTypes #100

Open
Shazwazza opened this issue Sep 20, 2018 · 0 comments
Open

Need to cache call to PluginManager.Current.ResolveTypes #100

Shazwazza opened this issue Sep 20, 2018 · 0 comments

Comments

@Shazwazza
Copy link

Shazwazza commented Sep 20, 2018

Any result of type finding needs to be cached statically like this call PluginManager.Current.ResolveTypes<LeBlenderController>();, see

var controllerTypes = PluginManager.Current.ResolveTypes<LeBlenderController>();

Types cannot be added to an AppDomain so once they are found they shouldn't be re-looked up. Luckily Umbraco stores this information so the re-scan doesn't consume CPU, however everytime this is called it adds a log entry which fills up users logs.

PluginManager resolution is normally combined with something Umbraco calls resolvers. It's up to you if you want to use a type resolver (there's tons of examples in the Umbraco core), but if you don't, the result of this call PluginManager.Current.ResolveTypes(); should be stored statically and only called one time per application.

@Shazwazza Shazwazza changed the title Need to cache call to PluginManager.Current.ResolveTypes<LeBlenderController>(); Need to cache call to PluginManager.Current.ResolveTypes Sep 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant