private Task <IList <Uri> > DeleteDependentUris(CacheEntry cacheEntry, ICacheMetadata metadata, IEnumerable <Uri> additionalDependentUris) { var uris = metadata.DependentUris ?? Enumerable.Empty <Uri>(); if (cacheEntry?.Metadata != null) { uris = uris.Concat(cacheEntry.Metadata.DependentUris ?? Enumerable.Empty <Uri>()); } uris = uris.Concat(additionalDependentUris ?? Enumerable.Empty <Uri>()); return(DeleteDependentUris(uris)); }
public CacheMetadata(ICacheMetadata context) : this() { if (context == null) { throw new ArgumentNullException(nameof(context)); } DependentUris.Merge(context.DependentUris); CacheDuration = context.CacheDuration; CacheableHttpMethods.Merge(context.CacheableHttpMethods); CacheableHttpStatusCodes.Merge(context.CacheableHttpStatusCodes); DefaultVaryByHeaders.Merge(context.DefaultVaryByHeaders); SuppressTypeMismatchExceptions = context.SuppressTypeMismatchExceptions; DefaultDurationForCacheableResults = context.DefaultDurationForCacheableResults; MustRevalidate = context.MustRevalidate; }
void IScavengingAlgorithm.Init(ICacheService cachingService, ICacheStorage cacheStorage, ICacheMetadata cacheMetadata, XmlNode configSection) { GXLogging.Debug(log, "Start LruScavenging.Init, initialize cacheStorage to '", () => cacheStorage + "'"); this.cachingService = cachingService; this.cacheStorage = cacheStorage; this.cacheMetadata = cacheMetadata; itemsLastUsed = new HybridDictionary(false); string size; if (Config.GetValueOf("CACHE_STORAGE_SIZE", out size) && Convert.ToInt32(size) > 0) { maxCacheStorageSize = Convert.ToInt32(size) * 1024; } else { maxCacheStorageSize = -1; } }
public void UpdateResponseMetadata(HttpRequestMessage request, HttpResponseMessage response, ICacheMetadata metadata) { Metadata = CachingHelpers.CreateResponseMetadata(Value, request, response, metadata); }
public CacheEntry(object result, HttpRequestMessage request, HttpResponseMessage response, ICacheMetadata metadata) : this(result, CachingHelpers.CreateResponseMetadata(result, request, response, metadata)) { }
public static IResponseMetadata CreateResponseMetadata(object result, HttpRequestMessage request, HttpResponseMessage response, ICacheMetadata context) { return(CreateResponseMetadata(result, request, response, true, context.CacheDuration, context.DependentUris, context.MustRevalidate, context.DefaultVaryByHeaders, context.DefaultDurationForCacheableResults)); }