gpt4 book ai didi

c# - 禁用 ASP.net 缓存

转载 作者:太空狗 更新时间:2023-10-29 18:03:44 28 4
gpt4 key购买 nike

有没有办法在所选页面上禁用 asp.net 缓存。如果这可以从 web.config 完成,那就太好了。

最佳答案

<!-- In the page itself -->
<%@ OutputCache Location="None" %>

或者

// In the code-behind
Response.Cache.SetCacheability(HttpCacheability.NoCache)

不幸的是,它必须在页面内完成。从 web.config 做这件事没有简单的方法。有关详细信息,请查看:

MSDN - Setting the Cacheability of a Page

关于c# - 禁用 ASP.net 缓存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3180513/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com