坚持页面输出缓存 [英] Persist page outputcache

查看:79
本文介绍了坚持页面输出缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即使在IIS重新启动或修改web.config之后,是否也可以使页面输出缓存保持不变?

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.

推荐答案

您可以通过实现OutputCacheProvider来实现自己的outputcache提供器:

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);
 }

有关进一步的阅读和实施方法,请阅读:创建-custom-output-cache-provider

For further reading and how to implement you can read: creating-a-custom-output-cache-provider

要阅读的更多资源: scottgu可扩展输出缓存与asp-net-4-vs-2010-and-net-4-0系列

这篇关于坚持页面输出缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆