프록시 캐시 플러그인 구성 참조
프록시 캐시 플러그인 구성 참조 (Proxy Cache Plugin Configuration Reference)
이 문서는 Kong의 프록시 캐시(Proxy Cache) 플러그인에서 설정할 수 있는 파라미터를 한눈에 확인할 수 있는 구성 참조 자료예요. cache_ttl, cache_control, content_type, request_method, response_code처럼 캐시 동작을 결정하는 핵심 옵션들의 기본값과 의미를 항목별로 설명해 줘요. 메모리 전략 사용 시 캐시 엔티티를 저장할 공유 딕셔너리 이름 지정 방법까지 다루고 있어서, 플러그인을 세밀하게 튜닝할 때 참고하기 좋아요
출처: 문서
본문
{
"properties": {
"config": {
"properties": {
"cache_by_principal": {
"default": false,
"description": "When enabled, use the authenticated Principal's UUID to compose the cache key.",
"type": "boolean"
},
"cache_control": {
"default": false,
"description": "When enabled, respect the Cache-Control behaviors defined in RFC7234.",
"type": "boolean"
},
"cache_ttl": {
"default": 300,
"description": "TTL, in seconds, of cache entities.",
"type": "integer"
},
"content_type": {
"default": [
"application/json",
"text/plain"
],
"description": "Upstream response content types considered cacheable. The plugin performs an **exact match** against each specified value.",
"items": {
"type": "string"
},
"type": "array"
},
"ignore_uri_case": {
"default": false,
"type": "boolean"
},
"memory": {
"properties": {
"dictionary_name": {
"default": "kong_db_cache",
"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.",
"type": "string"
}
},
"type": "object"
},
"request_method": {
"default": [
"GET",
"HEAD"
],
"description": "Downstream request methods considered cacheable.",
"items": {
"enum": [
"GET",
"HEAD",
"PATCH",
"POST",
"PUT"
],
"type": "string"
},
"type": "array"
},
"response_code": {
"default": [
200,
301,
404
],
"description": "Upstream response status code considered cacheable.",
"items": {
"maximum": 900,
"minimum": 100,
"type": "integer"
},
"minLength": 1,
"type": "array"
},
"response_headers": {
"description": "Caching related diagnostic headers that should be included in cached responses",
"properties": {
"X-Cache-Key": {
"default": true,
"type": "boolean"
},
"X-Cache-Status": {
"default": true,
"type": "boolean"
},
"age": {
"default": true,
"type": "boolean"
}
},
"type": "object"
},
"storage_ttl": {
"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.",
"type": "integer"
},
"strategy": {
"description": "The backing data store in which to hold cache entities.",
"enum": [
"memory"
],
"type": "string"
},
"vary_headers": {
"description": "Relevant headers considered for the cache key. If undefined, none of the headers are taken into consideration.",
"items": {
"type": "string"
},
"type": "array"
},
"vary_query_params": {
"description": "Relevant query parameters considered for the cache key. If undefined, all params are taken into consideration.",
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"strategy"
],
"type": "object"
},
"consumer": {
"additionalProperties": false,
"description": "If set, the plugin will activate only for requests where the specified has been authenticated. (Note that some plugins can not be restricted to consumers this way.). Leave unset for the plugin to activate regardless of the authenticated Consumer.",
"properties": {
"id": {
"type": "string"
}
},
"type": "object"
},
"consumer_group": {
"additionalProperties": false,
"description": "If set, the plugin will activate only for requests where the specified consumer group has been authenticated. (Note that some plugins can not be restricted to consumers groups this way.). Leave unset for the plugin to activate regardless of the authenticated Consumer Groups",
"properties": {
"id": {
"type": "string"
}
},
"type": "object"
},
"expressions": {
"additionalProperties": true,
"type": "object"
},
"protocols": {
"default": [
"grpc",
"grpcs",
"http",
"https"
],
"description": "A set of strings representing protocols.",
"items": {
"description": "A string representing a protocol, such as HTTP or HTTPS.",
"enum": [
"grpc",
"grpcs",
"http",
"https",
"tcp",
"tls",
"tls_passthrough",
"udp",
"ws",
"wss"
],
"type": "string"
},
"type": "array"
},
"route": {
"additionalProperties": false,
"description": "If set, the plugin will only activate when receiving requests via the specified route. Leave unset for the plugin to activate regardless of the route being used.",
"properties": {
"id": {
"type": "string"
}
},
"type": "object"
},
"service": {
"additionalProperties": false,
"description": "If set, the plugin will only activate when receiving requests via one of the routes belonging to the specified Service. Leave unset for the plugin to activate regardless of the Service being matched.",
"properties": {
"id": {
"type": "string"
}
},
"type": "object"
}
},
"required": [
"config"
]
}
관련 리소스
더 알아보기 (Learn more)
- 캐싱 기능을 더 강력하게 활용하고 싶다면 고급 버전 플러그인 문서를 확인해 보세요 — Proxy Cache Advanced plugin