caching 요소(ASP.NET 설정 스키마)
웹 응용 프로그램에 대한 캐시 설정을 구성합니다.
<caching>
<cache>...</cache>
<outputCache>...</outputCache>
<outputCacheSettings>...</outputCacheSettings>
<sqlCacheDependency>...</sqlCacheDependency>
</caching>
특성 및 요소
다음 단원에서는 특성, 자식 요소 및 부모 요소에 대해 설명합니다.
특성
없음
자식 요소
요소 |
설명 |
---|---|
Cache |
선택적 요소입니다. 응용 프로그램의 전역 캐시 설정을 정의합니다. |
outputCache |
선택적 요소입니다. 응용 프로그램 수준의 출력 캐시 설정을 지정합니다. |
outputCacheSettings |
선택적 요소입니다. 응용 프로그램의 페이지에 적용할 수 있는 출력 캐시 설정을 지정합니다. |
sqlCacheDependency |
선택적 요소입니다. ASP.NET 응용 프로그램의 SQL 캐시 종속성을 구성합니다. |
부모 요소
요소 |
설명 |
---|---|
configuration |
공용 언어 런타임 및 .NET Framework 응용 프로그램에서 사용하는 모든 구성 파일의 필수 루트 요소입니다. |
System.web |
구성 파일에 있는 ASP.NET 구성 설정의 루트 요소를 지정합니다. ASP.NET 웹 응용 프로그램을 구성하고 응용 프로그램의 동작 방법을 제어하는 구성 요소를 포함합니다. |
설명
기본 구성
다음의 기본 caching 요소는 Machine.config 파일이나 루트 Web.config 파일에 명시적으로 구성되어 있지는 않지만 .NET Framework 버전 2.0의 응용 프로그램에서 반환하는 기본 구성입니다.
<caching>
<cache disableMemoryCollection = "false"
disableExpiration = "false"
privateBytesLimit = "0"
percentagePhysicalMemoryUsedLimit = "90"
privateBytesPollTime = "00:02:00"/>
<outputCache enableOutputCache = "true"
enableFragmentCache = "true"
sendCacheControlHeader = "true"
omitVaryStar = "false" >
</outputCache>
<outputCacheSettings>
<outputCacheProfiles>
<clear />
<add name = ""
enabled = "true"
duration = "-1"
location = ""
sqlDependency = ""
varyByCustom = ""
varyByControl = ""
varyByHeader = ""
varyByParam = ""
noStore = "false"/>
</outputCacheProfiles>
</outputCacheSettings>
<sqlCacheDependency enabled = "true"
pollTime = "60000">
<databases>
<clear />
<add name = ""
connectionStringName = ""
pollTime = "60000"/>
</databases>
</sqlCacheDependency>
</caching>
예제
다음 코드 예제에서는 서버의 페이지를 1분 동안만 캐시한 후 브라우저 종류와 주 버전을 기준으로 페이지의 여러 버전을 저장합니다.
<outputCacheSettings>
<outputCacheProfiles>
<add name="ServerOnly"
duration="60"
varyByCustom="browser"
location="Server" />
</outputCacheProfiles>
</outputCacheSettings>
이러한 방법으로 캐시해야 하는 페이지를 디자인할 때는 다음 지시문을 페이지에 추가해야 합니다.
<%@ OutputCache CacheProfile="ServerOnly" %>
자세한 내용은 @ OutputCache을 참조하십시오.
요소 정보
구성 섹션 처리기 |
System.Web.Configuration.CacheSection System.Web.Configuration.OutputCacheSection |
구성 멤버 |
|
구성 가능한 위치 |
Machine.config 루트 수준의 Web.config 응용 프로그램 수준의 Web.config |
요구 사항 |
IIS 5.0, 5.1 및 6.0 .NET Framework 2.0 Visual Studio 2005 |
참고 항목
작업
참조
caching 요소에 대한 cache 요소(ASP.NET 설정 스키마)
caching 요소에 대한 outputCache 요소(ASP.NET 설정 스키마)
caching 요소에 대한 outputCacheSettings 요소(ASP.NET 설정 스키마)
caching 요소에 대한 sqlCacheDependency 요소(ASP.NET 설정 스키마)