0
votes

I setup an API Gateway with a Lambda Proxy and set caching on my staging URL using the Stage Editor Settings in API Gateway. Currently I have the Method Request caching the request path proxy.

I have noticed that GET requests work for my API and are individually cached. However when I do two POST requests sequentially with different JSON payloads. The Cache will be set for the first response data and then not realize that the second request has completely different payload and return the first response again. When the response data is completely different.

Is there a way to tell API Gateway to use the JSON payload as a cache key for POST method?

1
I know its a caching issue because when I disable cache for all POST it works... - rucas

1 Answers

0
votes

API Gateway doesn't support using JSON payload as cache key. You will need to disable caching for POST under stage settings (by expanding stage and resource path in the console UI). Alternatively, you may want to enable caching only for GET under stage settings.