다음을 통해 공유


CachingSection 클래스

출력 및 커널 캐싱을 구성합니다.

구문

class CachingSection : ConfigurationSectionWithCollection  

메서드

다음 표에서는 클래스에 의해 노출되는 메서드를 나열합니다 CachingSection .

속성 설명
추가 ConfigurationSectionWithCollection에서 상속됩니다.
지우기 ConfigurationSectionWithCollection에서 상속됩니다.
가져오기 ConfigurationSectionWithCollection에서 상속됩니다.
GetAllowDefinition ( ConfigurationSection에서 상속됩니다.)
GetAllowLocation ConfigurationSection에서 상속됩니다.
제거 ConfigurationSectionWithCollection에서 상속됩니다.
RevertToParent ConfigurationSection에서 상속됩니다.
SetAllowDefinition ConfigurationSection에서 상속됩니다.
SetAllowLocation ConfigurationSection에서 상속됩니다.

속성

다음 표에서는 클래스에 의해 노출되는 속성을 나열합니다 CachingSection .

속성 Description
Enabled 읽기/쓰기 boolean 값입니다. 출력 캐시 기능을 사용하면 true이고, 그렇지 않으면 false입니다. 출력 캐시를 사용하지 않도록 설정하면 응답 출력 캐싱 또는 커널 캐싱이 발생하지 않습니다. 기본값은 true입니다.
EnableKernelCache 읽기/쓰기 boolean 값입니다. 커널 캐시를 사용하면 true이고, 그렇지 않으면 false입니다. 기본값은 true입니다.
Location (에서 ConfigurationSection상속됨) 키 속성입니다.
MaxCacheSize 출력 캐시의 최대 크기(MB)를 지정하는 읽기/쓰기 uint32 값입니다. 기본값은 0입니다. 값이 0이면 캐시 메모리 크기가 자동으로 관리됩니다. 의 MaxValue 크기는 캐시 크기에 제한이 없음을 의미합니다. 참고: 이 설정은 ApplicationHost.config 파일 수준에서만 적용됩니다. 이 속성을 더 낮은 수준으로 설정하면 아무런 효과가 없습니다.
MaxResponseSize 출력 캐시에 저장할 수 있는 응답의 최대 크기(바이트)를 지정하는 읽기/쓰기 uint32 값입니다. 기본값은 262144(256KB)입니다. 0 설정은 제한이 없음을 의미합니다. 참고: 이 설정은 ApplicationHost.config 파일 수준에서만 적용됩니다. 이 속성을 더 낮은 수준으로 설정하면 아무런 효과가 없습니다.
Path (에서 ConfigurationSection상속됨) 키 속성입니다.
Profiles 특정 요청 확장에 대한 캐싱을 구성하는 CachingProfileSettings 값입니다.
SectionInformation ConfigurationSection에서 상속됩니다.

를 서브클래싱합니다.

이 클래스에는 서브클래스가 없습니다.

예제

다음 예제에서는 배열 속성의 CachingSection 값을 포함하여 CachingProfileSettings 기본 웹 사이트의 개체에 Profiles 속성을 표시합니다. , KernelCachePolicyLocation 열거형에 대한 텍스트를 표시하기 위해 Policy두 개의 도우미 함수가 제공됩니다.

' Connect to the WMI WebAdministration namespace.  
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")  
  
' Get the CachingSection for the default Web site.  
Set oSite = oWebAdmin.Get("Site.Name='Default Web Site'")  
oSite.GetSection "CachingSection", oSection  
  
' Display the path and location.  
Wscript.Echo "Path: " & oSection.Path  
Wscript.Echo "Location: " & oSection.Location  
Wscript.Echo   
  
' Display other non-array CachingSection properties.  
WScript.Echo "Enabled: " & oSection.Enabled  
Wscript.Echo "EnableKernelCache: " & oSection.EnableKernelCache  
Wscript.Echo "MaxCacheSize: " & oSection.MaxCacheSize  
Wscript.Echo "MaxResponseSize: " & oSection.MaxResponseSize  
Wscript.Echo   
  
' Display the caching profiles from the Profiles property.  
For Each oCachingProfileElement In oSection.Profiles.Profiles  
    Wscript.Echo   
    WScript.Echo "[ " & oCachingProfileElement.Extension & _  
        " ] Caching Profile"  
    WScript.Echo "-----------------------------------"  
    WScript.Echo "Duration: " & oCachingProfileElement.Duration  
    WScript.Echo "KernelCachePolicy: " & _  
        CachePolicyText(oCachingProfileElement.KernelCachePolicy)  
    WScript.Echo "Location: " & _  
        LocationText(oCachingProfileElement.Location)  
    WScript.Echo "Policy: " & _  
        CachePolicyText(oCachingProfileElement.Policy)  
    WScript.Echo "VaryByHeaders: " & _  
        oCachingProfileElement.VaryByHeaders  
    WScript.Echo "VaryByQueryString: " & _  
        oCachingProfileElement.VaryByQueryString  
    WScript.Echo               
Next  
  
' Provide text for KernelCachePolicy and Policy enumeration values.  
Function CachePolicyText(enumval)  
Select Case enumval  
    Case 0  
        CachePolicyText="DontCache"  
    Case 1  
        CachePolicyText="CacheUntilChange"  
    Case 2  
        CachePolicyText="CacheForTimePeriod"  
    Case Else  
        CachePolicyText="Undefined enumeration value"  
End Select  
End Function  
  
' Provide text for Location enumeration values.  
Function LocationText(enumval)  
Select Case enumval  
    Case 0  
        LocationText="Any"  
    Case 1  
        LocationText="Client"  
    Case 2  
        GetLocationText="Downstream"  
    Case 3  
        LocationText="Server"  
    Case 4  
        LocationText="None"  
    Case 5  
        LocationText="ServerAndClient"  
    Case Else  
        LocationText="Undefined enumeration value"  
End Select  
End Function  
  

상속 계층 구조

ConfigurationSection

ConfigurationSectionWithCollection

CachingSection

요구 사항

형식 Description
클라이언트 - Windows Vista의 IIS 7.0
- Windows 7의 IIS 7.5
- Windows 8의 IIS 8.0
- WINDOWS 10 IIS 10.0
서버 - Windows Server 2008의 IIS 7.0
- Windows Server 2008 R2의 IIS 7.5
- Windows Server 2012의 IIS 8.0
- Windows Server 2012 R2의 IIS 8.5
- WINDOWS SERVER 2016 IIS 10.0
제품 - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0
MOF 파일 WebAdministration.mof

참고 항목

AspCache 클래스
CachingProfileElement 클래스
CachingProfileSettings 클래스
ConfigurationSection 클래스
ConfigurationSectionWithCollection 클래스
HttpClientCache 클래스