0

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?

rucas
  • 3
  • 2

1 Answers1

0

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.

Balaji
  • 1,028
  • 8
  • 12
  • Thanks @Balaji! Do you have any idea when this feature would be available? – rucas Apr 20 '17 at 19:38
  • We do not have an ETA. We will discuss adding this feature in our roadmap, but that's not likely considering we haven't heard from other customers asking for this feature. – Balaji Apr 20 '17 at 23:19
  • This would be super useful for caching JSON RPCs to Ethereum nodes (`eth_call`) which commonly use POST. – sennett Aug 15 '22 at 10:44