AppSync supports server-side data caching. You can find the caching configuration under the appSync.caching
attribute.
appSync:
name: my-api
caching:
behavior: 'PER_RESOLVER_CACHING'
type: 'SMALL'
ttl: 3600
atRestEncryption: false
transitEncryption: false
behavior
:FULL_REQUEST_CACHING
orPER_RESOLVER_CACHING
type
: The type of the Redis instance.SMALL
,MEDIUM
,LARGE
,XLARGE
,LARGE_2X
,LARGE_4X
,LARGE_8X
,LARGE_12X
. Defaults toSMALL
ttl
: The default TTL of the cache in seconds. Defaults to3600
. Maximum is3600
enabled
: Boolean. Whether caching is enabled. Defaults totrue
when thecaching
definition is present.atRestEncryption
: Boolean. Whether to encrypt the data at rest. Defaults tofalse
transitEncryption
: Boolean. Whether to encrypt the data in transit. Defaults tofalse
See Resolver caching
You can use the flush-cache command to easily flush the cache.