问题
Is there an option to make page outputcache persist even after IIS restart or web.config modification?
Right now when I upload files the site recompiles and the outputcache resets and get cached upon the next page request.
回答1:
You can implement your own outputcache provider by implementing the OutputCacheProvider:
public abstract class OutputCacheProvider : ProviderBase
{
public abstract object Get(string key);
public abstract object Add(string key, object entry, DateTime utcExpiry);
public abstract void Set(string key, object entry, DateTime utcExpiry);
public abstract void Remove(string key);
}
For further reading and how to implement you can read: creating-a-custom-output-cache-provider
More resources to read: scottgu extensible-output-caching-with-asp-net-4-vs-2010-and-net-4-0-series
来源:https://stackoverflow.com/questions/44750235/persist-page-outputcache