关闭缓存 [英] Turn off caching

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

问题描述

我需要在ASP.NET页面中关闭缓存。我在页面加载事件中设置了以下代码




Response.Cache.SetCacheability(HttpCacheability.No Cache)


尽管如此,有时会从缓存中检索页面。我需要设置其他

选项吗?


TIA

Rohit

I need to turn off caching in my ASP.NET page. I have set the following code
in Page Load event:

Response.Cache.SetCacheability(HttpCacheability.No Cache)

Still, sometimes the page is retreived from cache. Are there any other
options I need to set?

TIA
Rohit

推荐答案

Rohit,


您要禁用哪个缓存?服务器上的缓存或客户端上的

缓存?如果您看到缓存数据,它可能是服务器端

或客户端


您是否在IE中检查了设置以查看页面是否为被缓存

客户端?


另外,你是否已经在IIS中启用了内容过期,因为你需要测试?b $ b测试?


最后,如果您通过ISA服务器查看页面

(防火墙/代理),请注意ISA可能会为您缓存页面:

INbound和OUTbound页面。


恭敬地,


Andrew Corley

" Rohit"写道:
Rohit,

Which cache are you trying to disable? The caching on the server or the
caching on the client? If you are seeing cached data, it could be server-side
or client-side

Have you checked you settings within IE to see if the page is being cached
client-side?

Also, have you enabled Content Expiration within IIS for the Web you are
testing?

Finally, if you are viewing the pages through the ISA server
(firewall/proxy), then be aware that ISA could be caching the pages for you:
both INbound and OUTbound pages.

Respectfully,

Andrew Corley

"Rohit" wrote:
我需要在我的ASP.NET页面中关闭缓存。我在页面加载事件中设置了以下代码:

Response.Cache.SetCacheability(HttpCacheability.No Cache)

仍然有时页面是从缓存。我还需要设置其他
选项吗?

TIA
Rohit
I need to turn off caching in my ASP.NET page. I have set the following code
in Page Load event:

Response.Cache.SetCacheability(HttpCacheability.No Cache)

Still, sometimes the page is retreived from cache. Are there any other
options I need to set?

TIA
Rohit



嗨Rohit,


我认为安德鲁的建议是合理的,因为可以有很多可以缓存页面的东西。尽管有asp.net服务器端或IIS

的缓存,如果要禁用的只是客户端浏览器的缓存,

你可以试试设置Response.Expire = -1,以使页面过期

立即在客户端。


谢谢。


问候,


Steven Cheng

微软在线支持


安全! www.microsoft.com/security

(此帖子按原样提供,不作任何保证,并且不授予

权利。)

Hi Rohit,

I think Andrew''s suggestions are reasonable since there could be many
things that can cache the page. In spite of the asp.net serverside or IIS
''s cache, if what you want to disable is just the client browser''s cache,
you can try set the Response.Expire = -1 so as to make the page expire
immediatly at client side.

Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


嗨Rohit,


关于这个问题的任何进一步的想法或问题?如果还有什么我们

可以提供帮助,请随时在这里发布。谢谢。


问候,


Steven Cheng

微软在线支持


安全! www.microsoft.com/security

(此帖子按原样提供,不作任何保证,并且不授予

权利。)

Hi Rohit,

Any further ideas or questions on this issue? If there is anything else we
can help, please feel free to post here. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


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

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