Great AppCaches renaming
This commit is contained in:
@@ -35,7 +35,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
Func<int, IPublishedContent> getParent,
|
||||
Func<int, XPathNavigator, IEnumerable<IPublishedContent>> getChildren,
|
||||
Func<DictionaryPublishedContent, string, IPublishedProperty> getProperty,
|
||||
ICacheProvider cacheProvider,
|
||||
IAppCache cacheProvider,
|
||||
PublishedContentTypeCache contentTypeCache,
|
||||
XPathNavigator nav,
|
||||
bool fromExamine)
|
||||
@@ -133,7 +133,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
//private readonly Func<DictionaryPublishedContent, IEnumerable<IPublishedContent>> _getChildren;
|
||||
private readonly Lazy<IEnumerable<IPublishedContent>> _getChildren;
|
||||
private readonly Func<DictionaryPublishedContent, string, IPublishedProperty> _getProperty;
|
||||
private readonly ICacheProvider _cacheProvider;
|
||||
private readonly IAppCache _cacheProvider;
|
||||
|
||||
/// <summary>
|
||||
/// Returns 'Media' as the item type
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
{
|
||||
internal class PublishedContentCache : PublishedCacheBase, IPublishedContentCache
|
||||
{
|
||||
private readonly ICacheProvider _cacheProvider;
|
||||
private readonly IAppCache _cacheProvider;
|
||||
private readonly IGlobalSettings _globalSettings;
|
||||
private readonly RoutesCache _routesCache;
|
||||
private readonly IDomainCache _domainCache;
|
||||
@@ -30,7 +30,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
public PublishedContentCache(
|
||||
XmlStore xmlStore, // an XmlStore containing the master xml
|
||||
IDomainCache domainCache, // an IDomainCache implementation
|
||||
ICacheProvider cacheProvider, // an ICacheProvider that should be at request-level
|
||||
IAppCache cacheProvider, // an ICacheProvider that should be at request-level
|
||||
IGlobalSettings globalSettings,
|
||||
ISiteDomainHelper siteDomainHelper,
|
||||
PublishedContentTypeCache contentTypeCache, // a PublishedContentType cache
|
||||
@@ -517,7 +517,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
// clear recursive properties cached by XmlPublishedContent.GetProperty
|
||||
// assume that nothing else is going to cache IPublishedProperty items (else would need to do ByKeySearch)
|
||||
// NOTE also clears all the media cache properties, which is OK (see media cache)
|
||||
_cacheProvider.ClearCacheObjectTypes<IPublishedProperty>();
|
||||
_cacheProvider.ClearOfType<IPublishedProperty>();
|
||||
//_cacheProvider.ClearCacheByKeySearch("XmlPublishedCache.PublishedContentCache:RecursiveProperty-");
|
||||
}
|
||||
|
||||
|
||||
@@ -43,9 +43,9 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
private readonly IEntityXmlSerializer _entitySerializer;
|
||||
|
||||
// must be specified by the ctor
|
||||
private readonly ICacheProvider _cacheProvider;
|
||||
private readonly IAppCache _cacheProvider;
|
||||
|
||||
public PublishedMediaCache(XmlStore xmlStore, IMediaService mediaService, IUserService userService, ICacheProvider cacheProvider, PublishedContentTypeCache contentTypeCache, IEntityXmlSerializer entitySerializer)
|
||||
public PublishedMediaCache(XmlStore xmlStore, IMediaService mediaService, IUserService userService, IAppCache cacheProvider, PublishedContentTypeCache contentTypeCache, IEntityXmlSerializer entitySerializer)
|
||||
: base(false)
|
||||
{
|
||||
_mediaService = mediaService ?? throw new ArgumentNullException(nameof(mediaService));
|
||||
@@ -66,7 +66,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
/// <param name="cacheProvider"></param>
|
||||
/// <param name="contentTypeCache"></param>
|
||||
/// <param name="entitySerializer"></param>
|
||||
internal PublishedMediaCache(IMediaService mediaService, IUserService userService, ISearcher searchProvider, ICacheProvider cacheProvider, PublishedContentTypeCache contentTypeCache, IEntityXmlSerializer entitySerializer)
|
||||
internal PublishedMediaCache(IMediaService mediaService, IUserService userService, ISearcher searchProvider, IAppCache cacheProvider, PublishedContentTypeCache contentTypeCache, IEntityXmlSerializer entitySerializer)
|
||||
: base(false)
|
||||
{
|
||||
_mediaService = mediaService ?? throw new ArgumentNullException(nameof(mediaService));
|
||||
@@ -678,7 +678,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
|
||||
var cache = Current.ApplicationCache.RuntimeCache;
|
||||
var key = PublishedMediaCacheKey + id;
|
||||
return (CacheValues)cache.GetCacheItem(key, () => func(id), _publishedMediaCacheTimespan);
|
||||
return (CacheValues)cache.Get(key, () => func(id), _publishedMediaCacheTimespan);
|
||||
}
|
||||
|
||||
internal static void ClearCache(int id)
|
||||
@@ -696,11 +696,11 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
// cache.ClearCacheItem(PublishedMediaCacheKey + GetValuesValue(exist.Values, "parentID"));
|
||||
|
||||
// clear the item
|
||||
cache.ClearCacheItem(key);
|
||||
cache.Clear(key);
|
||||
|
||||
// clear all children - in case we moved and their path has changed
|
||||
var fid = "/" + sid + "/";
|
||||
cache.ClearCacheObjectTypes<CacheValues>((k, v) =>
|
||||
cache.ClearOfType<CacheValues>((k, v) =>
|
||||
GetValuesValue(v.Values, "path", "__Path").Contains(fid));
|
||||
}
|
||||
|
||||
|
||||
@@ -13,11 +13,11 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
class PublishedMemberCache : IPublishedMemberCache
|
||||
{
|
||||
private readonly IMemberService _memberService;
|
||||
private readonly ICacheProvider _requestCache;
|
||||
private readonly IAppCache _requestCache;
|
||||
private readonly XmlStore _xmlStore;
|
||||
private readonly PublishedContentTypeCache _contentTypeCache;
|
||||
|
||||
public PublishedMemberCache(XmlStore xmlStore, ICacheProvider requestCacheProvider, IMemberService memberService, PublishedContentTypeCache contentTypeCache)
|
||||
public PublishedMemberCache(XmlStore xmlStore, IAppCache requestCacheProvider, IMemberService memberService, PublishedContentTypeCache contentTypeCache)
|
||||
{
|
||||
_requestCache = requestCacheProvider;
|
||||
_memberService = memberService;
|
||||
|
||||
@@ -38,10 +38,10 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
public IDomainCache Domains { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public ICacheProvider SnapshotCache => null;
|
||||
public IAppCache SnapshotCache => null;
|
||||
|
||||
/// <inheritdoc />
|
||||
public ICacheProvider ElementsCache => null;
|
||||
public IAppCache ElementsCache => null;
|
||||
|
||||
/// <inheritdoc />
|
||||
public IDisposable ForcedPreview(bool preview, Action<bool> callback = null)
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
private readonly IMemberService _memberService;
|
||||
private readonly IMediaService _mediaService;
|
||||
private readonly IUserService _userService;
|
||||
private readonly ICacheProvider _requestCache;
|
||||
private readonly IAppCache _requestCache;
|
||||
private readonly IGlobalSettings _globalSettings;
|
||||
private readonly IDefaultCultureAccessor _defaultCultureAccessor;
|
||||
private readonly ISiteDomainHelper _siteDomainHelper;
|
||||
@@ -42,7 +42,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
public PublishedSnapshotService(ServiceContext serviceContext,
|
||||
IPublishedContentTypeFactory publishedContentTypeFactory,
|
||||
IScopeProvider scopeProvider,
|
||||
ICacheProvider requestCache,
|
||||
IAppCache requestCache,
|
||||
IPublishedSnapshotAccessor publishedSnapshotAccessor, IVariationContextAccessor variationContextAccessor,
|
||||
IDocumentRepository documentRepository, IMediaRepository mediaRepository, IMemberRepository memberRepository,
|
||||
IDefaultCultureAccessor defaultCultureAccessor,
|
||||
@@ -63,7 +63,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
internal PublishedSnapshotService(ServiceContext serviceContext,
|
||||
IPublishedContentTypeFactory publishedContentTypeFactory,
|
||||
IScopeProvider scopeProvider,
|
||||
ICacheProvider requestCache,
|
||||
IAppCache requestCache,
|
||||
IPublishedSnapshotAccessor publishedSnapshotAccessor, IVariationContextAccessor variationContextAccessor,
|
||||
IDocumentRepository documentRepository, IMediaRepository mediaRepository, IMemberRepository memberRepository,
|
||||
IDefaultCultureAccessor defaultCultureAccessor,
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
[XmlType(Namespace = "http://umbraco.org/webservices/")]
|
||||
internal class XmlPublishedContent : PublishedContentBase
|
||||
{
|
||||
private XmlPublishedContent(XmlNode xmlNode, bool isPreviewing, ICacheProvider cacheProvider, PublishedContentTypeCache contentTypeCache)
|
||||
private XmlPublishedContent(XmlNode xmlNode, bool isPreviewing, IAppCache cacheProvider, PublishedContentTypeCache contentTypeCache)
|
||||
{
|
||||
_xmlNode = xmlNode;
|
||||
_isPreviewing = isPreviewing;
|
||||
@@ -31,7 +31,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
|
||||
private readonly XmlNode _xmlNode;
|
||||
private readonly bool _isPreviewing;
|
||||
private readonly ICacheProvider _cacheProvider; // at snapshot/request level (see PublishedContentCache)
|
||||
private readonly IAppCache _cacheProvider; // at snapshot/request level (see PublishedContentCache)
|
||||
private readonly PublishedContentTypeCache _contentTypeCache;
|
||||
|
||||
private readonly object _initializeLock = new object();
|
||||
@@ -426,7 +426,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
/// <remarks>Maintains a per-request cache of IPublishedContent items in order to make
|
||||
/// sure that we create only one instance of each for the duration of a request. The
|
||||
/// returned IPublishedContent is a model, if models are enabled.</remarks>
|
||||
public static IPublishedContent Get(XmlNode node, bool isPreviewing, ICacheProvider cacheProvider, PublishedContentTypeCache contentTypeCache)
|
||||
public static IPublishedContent Get(XmlNode node, bool isPreviewing, IAppCache cacheProvider, PublishedContentTypeCache contentTypeCache)
|
||||
{
|
||||
// only 1 per request
|
||||
|
||||
@@ -434,12 +434,12 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
var id = attrs?.GetNamedItem("id").Value;
|
||||
if (id.IsNullOrWhiteSpace()) throw new InvalidOperationException("Node has no ID attribute.");
|
||||
var key = CacheKeyPrefix + id; // dont bother with preview, wont change during request in Xml cache
|
||||
return (IPublishedContent) cacheProvider.GetCacheItem(key, () => (new XmlPublishedContent(node, isPreviewing, cacheProvider, contentTypeCache)).CreateModel());
|
||||
return (IPublishedContent) cacheProvider.Get(key, () => (new XmlPublishedContent(node, isPreviewing, cacheProvider, contentTypeCache)).CreateModel());
|
||||
}
|
||||
|
||||
public static void ClearRequest()
|
||||
{
|
||||
Current.ApplicationCache.RequestCache.ClearCacheByKeySearch(CacheKeyPrefix);
|
||||
Current.ApplicationCache.RequestCache.ClearByKey(CacheKeyPrefix);
|
||||
}
|
||||
|
||||
private const string CacheKeyPrefix = "CONTENTCACHE_XMLPUBLISHEDCONTENT_";
|
||||
|
||||
Reference in New Issue
Block a user