---
title: "Update Cache Settings"
method: PATCH
path: "/apiops/projects/{projectName}/apiProxies/{apiProxyName}/settings/cache/"
tags: ["ApiProxy"]
---

# Update Cache Settings

`PATCH /apiops/projects/{projectName}/apiProxies/{apiProxyName}/settings/cache/`

## Request

- Base URL: `http://167.86.118.166:32080`
- URL: `http://167.86.118.166:32080/apiops/projects/{projectName}/apiProxies/{apiProxyName}/settings/cache/`
- Auth: none declared
- TypeScript: <https://skmtc.dev/apinizer/apis/apinizer-management-apis/docs/apiops/projects/:projectName/apiProxies/:apiProxyName/settings/cache/patch.ts> (a function with typed inputs; its response is checked against the schema)

Updates Cache settings for the specified API Proxy

## Path parameters

- `projectName` string, required
- `apiProxyName` string, required

## Request body

- ApiProxyCacheSettingsUpdateDTO
  - `deploy` boolean: If true, deploy the API Proxy after saving changes
  - `deployTargetEnvironmentNameList` string[]: List of environment names to deploy to (required when deploy=true)
  - `cacheSettings` ApiOpsCacheSettingsPatchDTO: Partial update body for API Proxy cache settings. Every field is optional; an omitted (or null) field keeps the stored value.
    - `name` string: Name of the cache settings object. Omitted = unchanged.
    - `description` string: Description of the cache settings object. Omitted = unchanged.
    - `cacheActive` boolean: Enables response caching for this API Proxy. Omitted = unchanged.
    - `cacheOnlyHttpGetRequests` boolean: Caches only HTTP GET requests. Omitted = unchanged.
    - `cacheKeyType` 'QUERY_PARAMS' | 'CUSTOM': How the cache key is built (QUERY_PARAMS, BODY, VARIABLE, ...). Omitted = unchanged.
    - `cacheStorageType` 'LOCAL' | 'DISTRIBUTED': Where cached entries are stored (DISTRIBUTED or LOCAL). Omitted = unchanged.
    - `variableList` Variable[]: Variables that take part in the cache key. Omitted = unchanged; an empty array clears the list.
      - `id` string
      - `projectId` string
      - `projectName` string
      - `name` string
      - `description` string
      - `type` 'HEADER' | 'PARAMETER' | 'BODY' | 'CONTEXT_VALUES' | 'CUSTOM'
      - `headerName` string
      - `paramType` 'QUERY' | 'PATH' | 'FORM'
      - `paramName` string
      - `paramPath` string
      - `formName` string
      - `xpathValue` string
      - `jsonPathValue` string
      - `messageContentType` 'XML' | 'JSON' | 'ALL_BODY'
      - `contextValue` 'REQUEST_REMOTE_ADDRESS' | 'REQUEST_HTTP_METHOD' | 'REQUEST_CONTENT_TYPE' | 'REQUEST_PATH_INFO' | 'REQUEST_CONTEXT_PATH' | 'REQUEST_QUERY_STRING' | 'REQUEST_REMOTE_USER' | 'REQUEST_USERNAME_KEY' | 'REQUEST_REQUESTED_SESSION_ID' | 'REQUEST_REQUEST_URI' | 'REQUEST_CHARACTER_ENCODING' | 'REQUEST_CHARSET' | 'REQUEST_CONTENT_LENGTH' | 'REQUEST_PROTOCOL' | 'REQUEST_SCHEME' | 'REQUEST_SERVER_NAME' | 'REQUEST_SERVER_PORT' | 'REQUEST_REMOTE_HOST' | 'REQUEST_REMOTE_PORT' | 'REQUEST_LOCAL_NAME' | 'REQUEST_LOCAL_ADDR' | 'REQUEST_LOCAL_PORT' | 'REQUEST_XFORWARDED_FOR' | 'REQUEST_ESTIMATED_TOKEN_COUNT' | 'REQUEST_MCP_TOOL_NAME' | 'REQUEST_OAUTH_CLIENT_ID' | 'REQUEST_IS_SOAP_TO_REST' | 'REQUEST_IS_APIPROXY' | 'REQUEST_IS_APIPROXYGROUP' | 'REQUEST_IS_XWWW_FORM_URL_ENCODED' | 'REQUEST_IS_FORM_DATA' | 'REQUEST_IS_BYTE_ARRAY' | 'REQUEST_HAS_ATTACHMENT' | 'REQUEST_GZIP' | 'REQUEST_DEFLATE' | 'REQUEST_BR' | 'REQUEST_ZSTD' | 'REQUEST_IDENTITY' | 'REQUEST_COMPRESS' | 'REQUEST_HTTP_SERVLET' | 'RESPONSE_IS_BYTE_ARRAY' | 'RESPONSE_GZIP' | 'RESPONSE_DEFLATE' | 'RESPONSE_BR' | 'RESPONSE_ZSTD' | 'RESPONSE_IDENTITY' | 'RESPONSE_COMPRESS' | 'RESPONSE_BACKEND_CONTENT_ENCODING' | 'RESPONSE_CHARSET' | 'RESPONSE_STATUS_CODE' | 'RESPONSE_HTTP_SERVLET' | 'ERROR_CATEGORY' | 'ERROR_TYPE' | 'ERROR_PARENT' | 'ERROR_RESULT_TYPE' | 'ERROR_MESSAGE' | 'ERROR_CODE' | 'ERROR_HTTP_CODE' | 'MESSAGE_CORRELATION_ID' | 'MESSAGE_CACHE_HIT' | 'ENVIRONMENT_ID' | 'ENVIRONMENT_NAME' | 'ENVIRONMENT_CERTIFICATE' | 'ENVIRONMENT_PRIVATEKEY' | 'ENVIRONMENT_PUBLICKEY' | 'ENVIRONMENT_SECRETKEY' | 'ENVIRONMENT_KEYSTORE' | 'ENVIRONMENT_JWK' | 'APIPROXYGROUP_ID' | 'APIPROXYGROUP_NAME' | 'APIPROXY_ID' | 'APIPROXY_NAME' | 'APIPROXY_RELATIVE_PATH' | 'APIMETHOD_ID' | 'APIMETHOD_NAME' | 'APIMETHOD_SOAP_ACTION' | 'APIMETHOD_HTTPMETHOD' | 'APIMETHOD_ENDPOINT' | 'APIMETHOD_BACKEND_HTTPMETHOD' | 'APIMETHOD_BACKEND_ENDPOINT' | 'DATETIME_YEAR' | 'DATETIME_MONTH' | 'DATETIME_DAY_OF_WEEK' | 'DATETIME_DAY_OF_MONTH' | 'DATETIME_HOUR' | 'DATETIME_MINUTE' | 'DATETIME_SECOND' | 'DATETIME_EPOCH_MILLIS' | 'DATETIME_FORMATTED_TEXT' | 'DATE_FORMATTED_TEXT' | 'TIME_FORMATTED_TEXT' | 'CREDENTIAL_USERNAME' | 'CREDENTIAL_EMAIL' | 'CREDENTIAL_FULLNAME' | 'CREDENTIAL_SECRETKEY' | 'CREDENTIAL_CERTIFICATE' | 'CREDENTIAL_PUBLICKEY' | 'CREDENTIAL_PRIVATEKEY' | 'CREDENTIAL_KEYSTORE' | 'CREDENTIAL_TRUSTSTORE' | 'CREDENTIAL_JWK_SIGNANDVALIDATION' | 'CREDENTIAL_JWK_ENCRYPTIONANDDECRYPTION'
      - `zoneId` string
      - `initWithScript` boolean
      - `scriptLanguage` 'GROOVY' | 'JAVASCRIPT'
      - `scriptBody` string
    - `capacity` integer: Maximum number of cached entries. Omitted = unchanged.
    - `ttl` integer: Time to live of a cached entry, in seconds. Omitted = unchanged.
    - `invalidationRequiresAuthn` boolean: Requires an authenticated caller for cache invalidation requests. Omitted = unchanged.
    - `cacheNullValue` boolean: Caches empty/null backend responses as well. Omitted = unchanged.
    - `handlingAction` 'CONTINUE' | 'STOP': What the gateway does when the cache cannot be reached. Omitted = unchanged.
    - `cacheConnectionTimeoutInSeconds` integer: Connection timeout towards the distributed cache, in seconds. Omitted = unchanged.

## Response `200`

successful operation!

- ApiOpsResponseSuccess
  - `status` 'SUCCESS' | 'FAILURE'
  - `resultMessage` string
  - `resultList` string[]
  - `resultCount` integer
  - `deploymentResult` DeploymentResult
    - `envName` string
    - `podName` string
    - `podIp` string
    - `success` boolean
    - `detail` string
    - `responseTime` integer
    - `detailList` unknown[]
      - unknown
    - `firstFromApiResultList` unknown
  - `unresolvedReferences` string[]
  - `advisories` ApiOpsAdvisoryDTO[]
    - `level` string
    - `key` string
    - `params` object

## Other responses

- `401`: not authorized for this operation!
- `500`: internal error!

---

[API](https://skmtc.dev/apinizer/apis/apinizer-management-apis.md) - [All operations](https://skmtc.dev/apinizer/apis/apinizer-management-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/apinizer/apis/apinizer-management-apis/revisions/e083046b24cd?raw)
