diff --git a/build/NuSpecs/UmbracoCms.Web.nuspec b/build/NuSpecs/UmbracoCms.Web.nuspec
index 92cb0f065e..f12ada7e64 100644
--- a/build/NuSpecs/UmbracoCms.Web.nuspec
+++ b/build/NuSpecs/UmbracoCms.Web.nuspec
@@ -25,12 +25,12 @@
-->
-
+
-
+
-
+
diff --git a/src/Umbraco.Core/IDisposeOnRequestEnd.cs b/src/Umbraco.Core/IDisposeOnRequestEnd.cs
deleted file mode 100644
index 2515968b6d..0000000000
--- a/src/Umbraco.Core/IDisposeOnRequestEnd.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-using System;
-
-namespace Umbraco.Cms.Core
-{
- ///
- /// Any class implementing this interface that is added to the httpcontext.items keys or values will be disposed of at the end of the request.
- ///
- // TODO: Once UmbracoContext no longer needs this (see TODO in UmbracoContext), this should be killed
- public interface IDisposeOnRequestEnd : IDisposable
- {
- }
-}
diff --git a/src/Umbraco.Web.Common/Cache/HttpContextRequestAppCache.cs b/src/Umbraco.Web.Common/Cache/HttpContextRequestAppCache.cs
index 6d1b66c854..f43f9a9a24 100644
--- a/src/Umbraco.Web.Common/Cache/HttpContextRequestAppCache.cs
+++ b/src/Umbraco.Web.Common/Cache/HttpContextRequestAppCache.cs
@@ -5,8 +5,6 @@ using System.Linq;
using System.Threading;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Features;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Logging;
using Umbraco.Cms.Core.Events;
using Umbraco.Extensions;
@@ -21,7 +19,7 @@ namespace Umbraco.Cms.Core.Cache
/// in order to facilitate the correct locking and releasing allocations.
///
///
- public class HttpContextRequestAppCache : FastDictionaryAppCacheBase, IRequestCache, IDisposable
+ public class HttpContextRequestAppCache : FastDictionaryAppCacheBase, IRequestCache
{
private readonly IHttpContextAccessor _httpContextAccessor;
@@ -80,7 +78,10 @@ namespace Umbraco.Cms.Core.Cache
var value = result.Value; // will not throw (safe lazy)
if (value is SafeLazy.ExceptionHolder eh)
+ {
eh.Exception.Throw(); // throw once!
+ }
+
return value;
}
@@ -88,7 +89,10 @@ namespace Umbraco.Cms.Core.Cache
{
//no place to cache so just return the callback result
if (!TryGetContextItems(out var items))
+ {
return false;
+ }
+
key = GetCacheKey(key);
try
{
@@ -107,7 +111,10 @@ namespace Umbraco.Cms.Core.Cache
{
//no place to cache so just return the callback result
if (!TryGetContextItems(out var items))
+ {
return false;
+ }
+
key = GetCacheKey(key);
try
{
@@ -243,41 +250,6 @@ namespace Umbraco.Cms.Core.Cache
}
}
- // This is not a typical dispose pattern since this can be called multiple times to dispose
- // whatever might be in the current context.
- public void Dispose()
- {
- // need to resolve from request services since IRequestCache is a non DI service and we don't have a logger when created
- ILogger logger = _httpContextAccessor.HttpContext?.RequestServices?.GetRequiredService>();
- foreach (KeyValuePair i in this)
- {
- // NOTE: All of these will be Lazy