在ASP.NET清除页面缓存 [英] Clearing Page Cache in ASP.NET

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

问题描述

有关我的博客,我想使用输出缓存来保存perticular后约10分钟缓存版本,并且那细...

For my blog I am wanting to use the Output Cache to save a cached version of a perticular post for around 10 minutes, and thats fine...

<%@OutputCache Duration="600" VaryByParam="*" %>

不过,如果有人张贴评论,我想要清除缓存,以便刷新页面,注释就可以看出。

However, if someone posts a comment, I want to clear the cache so that the page is refreshed and the comment can be seen.

我如何做到这一点在ASP.Net C#?

How do I do this in ASP.Net C#?

推荐答案

我发现我一直在寻找的答案:

I've found the answer I was looking for:

HttpResponse.RemoveOutputCacheItem("/caching/CacheForever.aspx");

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

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