WindowsAuthenticationElement.DefaultCredentialsHandleCacheSize 属性

定义

定义 Windows 凭据处理缓存的默认大小。Defines the default size of the Windows credential handle cache.

public:
 property int DefaultCredentialsHandleCacheSize { int get(); void set(int value); };
[System.Configuration.ConfigurationProperty("defaultCredentialsHandleCacheSize", DefaultValue=Mono.Cecil.CustomAttributeArgument)]
public int DefaultCredentialsHandleCacheSize { get; set; }
[<System.Configuration.ConfigurationProperty("defaultCredentialsHandleCacheSize", DefaultValue=Mono.Cecil.CustomAttributeArgument)>]
member this.DefaultCredentialsHandleCacheSize : int with get, set
Public Property DefaultCredentialsHandleCacheSize As Integer

属性值

Int32

Windows 凭据句柄缓存的默认大小。The default size of the Windows credential handle cache.

属性

注解

默认情况下,的值 defaultCredentialsHandleCacheSize 为0。By default, the value of defaultCredentialsHandleCacheSize is 0. 这会导致 Windows 为每个分配单独的 SSPI 句柄 HttpWebRequestThis causes Windows to allocate a separate SSPI handle for each HttpWebRequest.

<system.net>
  <settings>
    <windowsAuthentication defaultCredentialsHandleCacheSize="0" />
  </settings>
</system.net>

如果此行为会影响性能,则将设置 DefaultCredentialsHandleCacheSize 为大于0的值,以便为默认网络凭据使用单个缓存的 SSPI 凭据句柄。If this behavior impacts performance, set DefaultCredentialsHandleCacheSize to a value greater than 0 to use a single, cached SSPI credential handle for default network credentials. 确切的值取决于应用程序要求。The exact value depends on application requirements. 通常,在50和100之间的值适用于大多数高性能的应用程序。Generally, a value between 50 and 100 works for most high-performant applications.

适用于