프록시 캐시 정책 구성 레퍼런스
프록시 캐시 정책 구성 레퍼런스 (Proxy Cache Policy Configuration Reference)
이 문서는 Kong에서 프록시 캐시 정책을 구성할 때 사용할 수 있는 설정 옵션을 스키마 형태로 정리한 참고 자료예요. Cache-Control 동작 준수 여부, 스토리지에 리소스를 유지하는 시간(storage_ttl), 캐싱 대상 응답 상태 코드, 캐시 키를 구성하는 쿼리 파라미터와 헤더 같은 핵심 항목을 확인할 수 있어요. 메모리 전략용 공유 딕셔너리 이름이나 X-Cache-Status 같은 진단 헤더 노출 설정까지 세부적으로 제어하는 방법도 함께 다뤄요
출처: 문서
본문
{
"properties": {
"config": {
"type": "object",
"properties": {
"cache_control": {
"type": "boolean",
"description": "When enabled, respect the Cache-Control behaviors defined in RFC7234.",
"default": false
},
"ignore_uri_case": {
"type": "boolean",
"default": false
},
"storage_ttl": {
"type": "integer",
"description": "Number of seconds to keep resources in the storage backend. This value is independent of `cache_ttl` or resource TTLs defined by Cache-Control behaviors."
},
"memory": {
"type": "object",
"properties": {
"dictionary_name": {
"type": "string",
"description": "The name of the shared dictionary in which to hold cache entities when the memory strategy is selected. Note that this dictionary currently must be defined manually in the Kong Nginx template.",
"default": "kong_db_cache"
}
}
},
"response_code": {
"type": "array",
"items": {
"type": "integer",
"maximum": 900,
"minimum": 100
},
"minLength": 1,
"description": "Upstream response status code considered cacheable.",
"default": [
200,
301,
404
]
},
"vary_query_params": {
"type": "array",
"items": {
"type": "string"
},
"description": "Relevant query parameters considered for the cache key. If undefined, all params are taken into consideration."
},
"vary_headers": {
"type": "array",
"items": {
"type": "string"
},
"description": "Relevant headers considered for the cache key. If undefined, none of the headers are taken into consideration."
},
"response_headers": {
"type": "object",
"properties": {
"age": {
"type": "boolean",
"default": true
},
"X-Cache-Status": {
"type": "boolean",
"default": true
},
"X-Cache-Key": {
"type": "boolean",
"default": true
}
},
"description": "Caching related diagnostic headers that should be included in cached responses"
},
"request_method": {
"type": "array",
"items": {
"type": "string",
"enum": [
"GET",
"HEAD",
"PATCH",
"POST",
"PUT"
]
},
"description": "Downstream request methods considered cacheable.",
"default": [
"GET",
"HEAD"
]
},
"content_type": {
"type": "array",
"items": {
"type": "string"
},
"description": "Upstream response content types considered cacheable. The policy performs an **exact match** against each specified value.",
"default": [
"application/json",
"text/plain"
]
},
"cache_ttl": {
"type": "integer",
"description": "TTL, in seconds, of cache entities.",
"default": 300
},
"strategy": {
"type": "string",
"enum": [
"memory"
],
"description": "The backing data store in which to hold cache entities."
}
},
"required": [
"strategy"
]
}
}
}
더 알아보기 (Learn more)
이 문서에는 원문에서 추출한 별도의 관련 문서 링크가 없어요.