全局禁用缓存.NET缓存、全局、NET

2023-09-03 05:07:34 作者:你并不缺我

有没有办法来全局禁用服务器缓存中的ASP.NET?就像通过添加某种设置为web.config文件的?

到目前为止,我已经尝试添加这些和它没有有所作为......

 <缓存>
          <的SqlCacheDependency启用=假>< /的SqlCacheDependency>
            <的OutputCache enableOutputCache =假
                enableFragmentCache =假
                sendCacheControlHeader =假
                omitVaryStar =FALSE/>
        < /缓存>
 

解决方案

还有,如果你正在使用IIS7 / 7.5或IIS防爆preSS禁用这system.webServer的一种方式。这将在您的主web.config文件的工作(对于WebForms和MVC),并在web.config文件中的子文件夹,将其禁用您的应用程序的特定区域。

 < system.webServer>
    <缓存启用=FALSE/>
< /system.webServer>
 

asp.net如何处理缓存

is there a way to disable server caching globally in ASP.NET? Like by adding some sort of setting to the web.config file?

So far I've tried adding these and it didnt make a difference...

        <caching>
          <sqlCacheDependency enabled="false"></sqlCacheDependency>
            <outputCache enableOutputCache="false"
                enableFragmentCache="false"
                sendCacheControlHeader="false"
                omitVaryStar="false" />
        </caching>

解决方案

There is also a way of disabling this in system.webServer if you are using IIS7/7.5 or IIS Express. This will work in your main web.config file (for both webforms and mvc) and also in web.config files in subfolders, to disable it for particular areas of your application.

<system.webServer>
    <caching enabled="false" />
</system.webServer>

 
精彩推荐
图片推荐