HttpClientCache 클래스
HTTP 클라이언트에 대한 캐싱 구성을 노출합니다.
구문
class HttpClientCache : EmbeddedObject
메서드
이 클래스에는 메서드가 없습니다.
속성
다음 표에서는 클래스에서 노출하는 속성을 나열합니다 HttpClientCache
.
속성 | Description |
---|---|
CacheControlCustom |
응답에 추가할 HTTP 1.1 Cache-Control 헤더를 지정하는 읽기/쓰기 string 값입니다. |
CacheControlMaxAge |
HTTP 1.1 캐시 컨트롤의 최대 기간을 지정하는 읽기/쓰기 datetime 값입니다. 기본값은 1일입니다. |
CacheControlMode |
클라이언트 캐싱에 사용할 모드를 지정하는 읽기/쓰기 sint32 열거형입니다. 가능한 값은 설명 섹션의 뒷부분에 나열됩니다. |
HttpExpires |
RFC(Request for Comments) 1123 형식에서 캐시된 응답이 부실한 것으로 간주되는 날짜 및 시간을 지정하는 읽기/쓰기 string 값입니다. |
를 서브클래싱합니다.
이 클래스에는 하위 클래스가 없습니다.
설명
이 클래스의 인스턴스는 StaticContentSection 클래스의 배열 속성에 포함 ClientCache
됩니다.
다음 표에는 속성에 대한 가능한 값이 포함되어 있습니다 CacheControlMode
. 기본값은 0(NoControl
)입니다.
값 | 키워드 | Description |
---|---|---|
0 | NoControl |
응답에 Cache-Control 또는 Expires 헤더를 추가하지 않습니다. |
1 | DisableCache |
Cache-Control: no-cache 헤더를 응답에 추가합니다. |
2 | UseMaxAge |
속성에 Cache-Control: max-age=<nnn> 지정된 값에 따라 응답에 헤더를 CacheControlMaxAge 추가합니다. |
3 | UseExpires |
속성에 Expires: <date> 지정된 날짜에 따라 응답에 헤더를 HttpExpires 추가합니다. |
헤더 필드에 대한 자세한 내용은 RFC(주석 요청) 2616, "하이퍼텍스트 전송 프로토콜 -- HTTP/1.1"을 참조하세요.
날짜 및 시간 형식에 대한 자세한 내용은 RFC 1123, "인터넷 호스트 요구 사항 -- 애플리케이션 및 지원"을 참조하세요.
예제
다음 예제에서는 클래스의 속성을 표시합니다 HttpClientCache
.
' Connect to the WMI WebAdministration namespace.
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")
' Retrieve the static content section.
Set oSection = oWebAdmin.Get("StaticContentSection.Path=" & _
"'MACHINE/WEBROOT/APPHOST',Location=''")
' Show the path and location.
WScript.Echo "Path: " & oSection.Path
WScript.Echo "Location: " & oSection.Location
WScript.Echo
Display the embedded HttpClientCache properties.
Set ohttpClientCache = oSection.ClientCache
WScript.Echo "HttpClientCache properties"
WScript.Echo "--------------------------"
WScript.Echo "CacheControlCustom: " & ohttpClientCache.CacheControlCustom
WScript.Echo "CacheControlMaxAge: " & ohttpClientCache.CacheControlMaxAge
WScript.Echo "CacheControlMode: " & _
GetCacheControlModeText(ohttpClientCache.CacheControlMode)
WScript.Echo "HttpExpires: " & ohttpClientCache.HttpExpires
' Provide text for CacheControlMode enumeration values.
Function GetCacheControlModeText(uint32Mode)
Select Case uint32Mode
Case 0
GetCacheControlModeText="NoControl"
Case 1
GetCacheControlModeText="DisableCache"
Case 2
GetCacheControlModeText="UseMaxAge"
Case 3
GetCacheControlModeText="UseExpires"
Case Else
GetCacheControlModeText="Unknown Mode"
End Select
End Function
상속 계층 구조
HttpClientCache
요구 사항
형식 | 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 |
참고 항목
EmbeddedObject 클래스
StaticContentSection 클래스
CIM_DATETIME
Datetime.Parse 메서드