Revert "Virtualizing registration of the cache helper"
This reverts commit 04944f2c0c.
This commit is contained in:
@@ -195,7 +195,15 @@ namespace Umbraco.Core.Runtime
|
||||
|
||||
container.ComposeConfiguration();
|
||||
|
||||
RegisterCacheHelper(container);
|
||||
// register caches
|
||||
// need the deep clone runtime cache profiver to ensure entities are cached properly, ie
|
||||
// are cloned in and cloned out - no request-based cache here since no web-based context,
|
||||
// will be overriden later or
|
||||
container.RegisterSingleton(_ => new CacheHelper(
|
||||
new DeepCloneRuntimeCacheProvider(new ObjectCacheRuntimeCacheProvider()),
|
||||
new StaticCacheProvider(),
|
||||
NullCacheProvider.Instance,
|
||||
new IsolatedRuntimeCache(type => new DeepCloneRuntimeCacheProvider(new ObjectCacheRuntimeCacheProvider()))));
|
||||
container.RegisterSingleton(f => f.GetInstance<CacheHelper>().RuntimeCache);
|
||||
|
||||
// register the plugin manager
|
||||
@@ -228,22 +236,6 @@ namespace Umbraco.Core.Runtime
|
||||
container.RegisterSingleton<MainDom>();
|
||||
}
|
||||
|
||||
protected virtual void RegisterCacheHelper(IContainer container)
|
||||
{
|
||||
// register caches
|
||||
// need the deep clone runtime cache profiver to ensure entities are cached properly, ie
|
||||
// are cloned in and cloned out - no request-based cache here since no web-based context,
|
||||
// will be overriden later or
|
||||
container.RegisterSingleton(
|
||||
"CacheHelper",
|
||||
_ => new CacheHelper(
|
||||
new DeepCloneRuntimeCacheProvider(new ObjectCacheRuntimeCacheProvider()),
|
||||
new StaticCacheProvider(),
|
||||
NullCacheProvider.Instance,
|
||||
new IsolatedRuntimeCache(type =>
|
||||
new DeepCloneRuntimeCacheProvider(new ObjectCacheRuntimeCacheProvider()))));
|
||||
}
|
||||
|
||||
protected virtual void ComposeMapperCollection(MapperCollectionBuilder builder)
|
||||
{
|
||||
builder.AddCore();
|
||||
|
||||
@@ -57,25 +57,20 @@ namespace Umbraco.Web.Runtime
|
||||
// replace CoreRuntime's IProfiler registration
|
||||
container.RegisterSingleton(_ => _webProfiler);
|
||||
|
||||
container.RegisterSingleton<IHttpContextAccessor, AspNetHttpContextAccessor>(); // required for hybrid accessors
|
||||
}
|
||||
|
||||
protected override void RegisterCacheHelper(IContainer container)
|
||||
{
|
||||
// replace CoreRuntime's CacheHelper registration
|
||||
container.RegisterSingleton(
|
||||
"CacheHelper",
|
||||
_ => new CacheHelper(
|
||||
container.RegisterSingleton(_ => new CacheHelper(
|
||||
// we need to have the dep clone runtime cache provider to ensure
|
||||
// all entities are cached properly (cloned in and cloned out)
|
||||
new DeepCloneRuntimeCacheProvider(new HttpRuntimeCacheProvider(HttpRuntime.Cache)),
|
||||
new StaticCacheProvider(),
|
||||
// we need request based cache when running in web-based context
|
||||
new HttpRequestCacheProvider(),
|
||||
new IsolatedRuntimeCache(type =>
|
||||
// we need to have the dep clone runtime cache provider to ensure
|
||||
// all entities are cached properly (cloned in and cloned out)
|
||||
new DeepCloneRuntimeCacheProvider(new HttpRuntimeCacheProvider(HttpRuntime.Cache)),
|
||||
new StaticCacheProvider(),
|
||||
// we need request based cache when running in web-based context
|
||||
new HttpRequestCacheProvider(),
|
||||
new IsolatedRuntimeCache(type =>
|
||||
// we need to have the dep clone runtime cache provider to ensure
|
||||
// all entities are cached properly (cloned in and cloned out)
|
||||
new DeepCloneRuntimeCacheProvider(new ObjectCacheRuntimeCacheProvider()))));
|
||||
new DeepCloneRuntimeCacheProvider(new ObjectCacheRuntimeCacheProvider()))));
|
||||
|
||||
container.RegisterSingleton<IHttpContextAccessor, AspNetHttpContextAccessor>(); // required for hybrid accessors
|
||||
}
|
||||
|
||||
#region Getters
|
||||
|
||||
Reference in New Issue
Block a user