responsecache

Programmatically clear cache profile in asp.net core

不羁岁月 提交于 2019-12-19 09:18:22
问题 I have setup a cache profile in my asp.net core web api as follows: services.AddMvc(options => { // Cache profile for lookup data will expire every 15 minutes. options.CacheProfiles.Add("LookupData", new CacheProfile() { Duration = 15 }); }); I have used this attribute at the top of my "lookupsController", as the lists of information returned in each method won't change regularly (although cache automatically expires every 15 minutes). [ResponseCache(CacheProfileName = "LookupData")]

ASP.Net Core 2.0 - ResponseCaching Middleware - Not Caching on Server

独自空忆成欢 提交于 2019-12-18 13:25:51
问题 I want to use server-side response caching (output cache) with asp.net core 2.0 and found out about Response Caching Middleware and wanted to give it a try with a brand new asp.core mvc project. Here is the description from the link above which makes me think this could be used like output cache. The middleware determines when responses are cacheable, stores responses, and serves responses from cache. Here is how my startup.cs looks like. public class Startup { public Startup(IConfiguration

ASP.Net Core 2.0 - ResponseCaching Middleware - Not Caching on Server

折月煮酒 提交于 2019-11-30 09:55:02
I want to use server-side response caching (output cache) with asp.net core 2.0 and found out about Response Caching Middleware and wanted to give it a try with a brand new asp.core mvc project. Here is the description from the link above which makes me think this could be used like output cache. The middleware determines when responses are cacheable, stores responses, and serves responses from cache. Here is how my startup.cs looks like. public class Startup { public Startup(IConfiguration configuration) { Configuration = configuration; } public IConfiguration Configuration { get; } // This