adds tests for caching exceptions and only caching one time and fixes HttpRequestCacheProvider to work with them.

This commit is contained in:
Shannon
2015-05-19 15:57:11 +10:00
parent 0e5a469577
commit 444a028e30
2 changed files with 57 additions and 2 deletions

View File

@@ -2,6 +2,7 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Web;
namespace Umbraco.Core.Cache
@@ -105,7 +106,7 @@ namespace Umbraco.Core.Cache
if (result == null || GetSafeLazyValue(result, true) == null) // get non-created as NonCreatedValue & exceptions as null
{
result = new Lazy<object>(getCacheItem);
result = new Lazy<object>(getCacheItem, LazyThreadSafetyMode.PublicationOnly);
ContextItems[cacheKey] = result;
}
}