Persist page outputcache

落爺英雄遲暮 提交于 2019-12-12 04:31:28

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!