working on region clearing cache, if using cachemanager back plance this would clear all servers in cluster

This commit is contained in:
Tom Gardham-Pallister
2017-06-26 19:10:20 +01:00
parent 26e7621798
commit 239dcfb6bd
8 changed files with 155 additions and 12 deletions

View File

@ -63,7 +63,9 @@ namespace Ocelot.Cache.Middleware
var response = HttpResponseMessage;
_outputCache.Add(downstreamUrlKey, response, TimeSpan.FromSeconds(DownstreamRoute.ReRoute.FileCacheOptions.TtlSeconds));
var region = $"{DownstreamRoute.ReRoute.UpstreamHttpMethod}-{DownstreamRoute.ReRoute.UpstreamPathTemplate.Value}";
_outputCache.Add(downstreamUrlKey, response, TimeSpan.FromSeconds(DownstreamRoute.ReRoute.FileCacheOptions.TtlSeconds), region);
_logger.LogDebug("finished response added to cache for {downstreamUrlKey}", downstreamUrlKey);
}