Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
用于asp.net输出缓存的Windows Server Appfabric提供程序_Asp.net_Appfabric - Fatal编程技术网

用于asp.net输出缓存的Windows Server Appfabric提供程序

用于asp.net输出缓存的Windows Server Appfabric提供程序,asp.net,appfabric,Asp.net,Appfabric,Windows Server AppFabric 1.0是否存在asp.net输出缓存提供程序 否。但由于输出缓存在ASP.NET 4.0中是可插入的(使用提供程序模型),因此您可以编写自己的缓存 要创建新的输出缓存提供程序,您需要从System.Web.Caching.OutputCacheProvider继承,您需要引用System.Web和System.Configuration 然后,主要是重写基础提供程序中的四个方法:Add、Get、Remove和Set 由于您的站点可能会获得相当多的

Windows Server AppFabric 1.0是否存在asp.net输出缓存提供程序

否。但由于输出缓存在ASP.NET 4.0中是可插入的(使用提供程序模型),因此您可以编写自己的缓存

要创建新的输出缓存提供程序,您需要从
System.Web.Caching.OutputCacheProvider
继承,您需要引用
System.Web
System.Configuration

然后,主要是重写基础提供程序中的四个方法:Add、Get、Remove和Set

由于您的站点可能会获得相当多的点击率,您肯定会希望为DataCacheFactory使用单例,这段代码使用单例(假设我理解正确)

一旦编写了此文件,您需要将应用程序配置为在web.config中使用它:

<system.web>
    <caching>
        <outputCache defaultProvider="AppFabricOutputCache">
            <providers>
                <add name="AppFabricOutputCache" type="AppFabricOutputCache, AppFabricOutputCacheProvider" />
            </providers>
        </outputCache>
     </caching>
</system.web>


<system.web>
    <caching>
        <outputCache defaultProvider="AppFabricOutputCache">
            <providers>
                <add name="AppFabricOutputCache" type="AppFabricOutputCache, AppFabricOutputCacheProvider" />
            </providers>
        </outputCache>
     </caching>
</system.web>