关闭缓存

编程入门 行业动态 更新时间:2024-10-21 23:15:19
本文介绍了关闭缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我需要在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服务器端或IIS 的缓存,如果要禁用的只是客户端浏览器的缓存, 你可以试试设置Response.Expire = -1,以使页面过期 立即在客户端。 谢谢。 问候, Steven Cheng 微软在线支持 安全! www.microsoft/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 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/security (This posting is provided "AS IS", with no warranties, and confers no rights.)

嗨Rohit, 关于这个问题的任何进一步的想法或问题?如果还有什么我们 可以提供帮助,请随时在这里发布。谢谢。 问候, Steven Cheng 微软在线支持 安全! www.microsoft/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/security (This posting is provided "AS IS", with no warranties, and confers no rights.)

更多推荐

关闭缓存

本文发布于:2023-11-01 01:31:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1547855.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:缓存

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!