Configuration Reference
Complete reference for all global and per-endpoint caching settings.
Global Settings
Configure under custom.interlaceCaching in your serverless.yml:
custom:
interlaceCaching:
enabled: true
clusterSize: '0.5'
ttlInSeconds: 300
dataEncrypted: false
flushOnDeploy: false
perKeyInvalidation:
requireAuthorization: true
handleUnauthorizedRequests: Ignore
endpointsInheritCloudWatchSettingsFromStage: trueProperties
| Property | Type | Default | Description |
|---|---|---|---|
enabled | boolean | false | Enable the cache cluster |
clusterSize | string | '0.5' | Size in GB: 0.5, 1.6, 6.1, 13.5, 28.4, 58.2, 118, 237 |
ttlInSeconds | number | 300 | Default TTL (0–3600) |
dataEncrypted | boolean | false | Encrypt cached data at rest |
flushOnDeploy | boolean | false | Flush cache after every deploy |
sharedApiGateway | boolean | false | Skip stage-level cluster changes |
restApiId | string | auto | Explicit REST API ID |
basePath | string | — | Path prefix for shared gateways |
endpointsInheritCloudWatchSettingsFromStage | boolean | true | Copy CloudWatch settings to methods |
perKeyInvalidation | object | — | Default invalidation settings |
additionalEndpoints | array | [] | CF-defined endpoints to cache |
Cache Cluster Sizes
The plugin enum-validates clusterSize to the AWS-allowed values:
'0.5', '1.6', '6.1', '13.5', '28.4', '58.2', '118', '237' (all GB).
For pricing per size, refer to the official API Gateway pricing page under "API caching" — AWS publishes per-region rates and the numbers change. We don't restate them here so the docs don't drift out of sync with what you'll actually be billed.
Per-Endpoint Settings
Configure on each HTTP event:
functions:
getUser:
handler: src/handler.get
events:
- http:
path: /users/{id}
method: get
caching:
enabled: true
ttlInSeconds: 600
dataEncrypted: true
inheritCloudWatchSettingsFromStage: false
perKeyInvalidation:
requireAuthorization: true
handleUnauthorizedRequests: Fail
cacheKeyParameters:
- name: request.path.idProperties
| Property | Type | Default | Description |
|---|---|---|---|
enabled | boolean | false | Enable caching for this endpoint |
ttlInSeconds | number | global | Override TTL |
dataEncrypted | boolean | global | Override encryption |
inheritCloudWatchSettingsFromStage | boolean | true | Override CloudWatch inheritance |
perKeyInvalidation | object | global | Override invalidation settings |
cacheKeyParameters | array | [] | Cache key parameters |
Per-Key Cache Invalidation
Control how clients invalidate specific cache entries using the Cache-Control: max-age=0 header:
| Strategy | Behavior |
|---|---|
Ignore | Silently ignore unauthorized invalidation |
IgnoreWithWarning | Ignore but add a Warning response header |
Fail | Return 403 Forbidden |
ANY Method Behavior
For HTTP method ANY, caching is enabled only for GET and explicitly disabled for DELETE, HEAD, OPTIONS, PATCH, POST, and PUT.