Configuration

configobjectrequired
Hide Child Parameters
cache_controlboolean

When enabled, respect the Cache-Control behaviors defined in RFC7234.

Default:false

cache_ttlinteger

TTL, in seconds, of cache entities.

Default:300

>= 0

content_typearray[string]

Upstream response content types considered cacheable. The plugin performs an exact match against each specified value.

Default:application/json, text/plain

ignore_uri_caseboolean

Default:false

memoryobject
Hide Child Parameters
dictionary_namestring

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

request_methodarray[string]

Downstream request methods considered cacheable.

Allowed values:GETHEADPATCHPOSTPUT

Default:GET, HEAD

response_codearray[integer]

Upstream response status code considered cacheable.

Default:200, 301, 404

>= 100<= 900>= 1 characters

response_headersobject

Caching related diagnostic headers that should be included in cached responses

Hide Child Parameters
X-Cache-Keyboolean

Default:true

X-Cache-Statusboolean

Default:true

ageboolean

Default:true

storage_ttlinteger

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.

strategystringrequired

The backing data store in which to hold cache entities.

Allowed values:memory

vary_headersarray[string]

Relevant headers considered for the cache key. If undefined, none of the headers are taken into consideration.

vary_query_paramsarray[string]

Relevant query parameters considered for the cache key. If undefined, all params are taken into consideration.

consumerobject

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.

* Additional properties are NOT allowed.
Hide Child Parameters
idstring
consumer_groupobject

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

* Additional properties are NOT allowed.
Hide Child Parameters
idstring
protocolsarray[string]

A string representing a protocol, such as HTTP or HTTPS.

Allowed values:grpcgrpcshttphttpstcptlstls_passthroughudpwswss

Default:grpc, grpcs, http, https

routeobject

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.

* Additional properties are NOT allowed.
Hide Child Parameters
idstring
serviceobject

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.

* Additional properties are NOT allowed.
Hide Child Parameters
idstring

Did this doc help?

Something wrong?

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!