Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS API Gateway caches POST data

I turned on the cache to cache GET requests but it also applies to POST, since post has no query string it currently caches the POST once and sticks with it no matter the POST body.

Is there a way to turn this off for the POST method or tell the cache that the post body has the key to cache it?

like image 919
Toby Avatar asked Apr 30 '26 01:04

Toby


1 Answers

I would start by reading the documentation on this feature carefully.

You can enable caching at the stage level, and you can override cache settings at the method level. You can also specify headers, URL paths and query strings to be used as the cache key.

It's not clear what you have done at this point but you should be able to do one of the following to achieve your goals:

  1. Enable caching at the stage level, and disable at the method level for the POST method.
  2. Disable caching at the stage level, and enable caching at the method level for the GET method.
like image 158
Mark B Avatar answered May 01 '26 18:05

Mark B