- Newest
- Most votes
- Most comments
I am not sure if this is what your looking for or if I understand correctly. Maybe this will help you
-
Open the API Gateway console and select your API.
-
Click on the resource that contains the endpoint you want to enable caching for (in your case, this would be the resource containing the GET /products/{id} endpoint).
-
Click on the method (GET in this case) for the endpoint.
-
Under the Method Execution pane, expand the Caching section.
-
Enable caching by selecting Enable API caching and configuring the Cache Settings. You can set the Cache Time-to-Live (TTL) and the Cache Data Encrypted options based on your requirements.
-
Save the changes to the method.
Now, the GET /products/{id} endpoint will use caching, while the other endpoints will not.
Enabling caching at the method level will override the settings at the stage level.
Relevant content
- asked 3 years ago
- Accepted Answerasked 10 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 2 months ago
Thanks for the reply. However, I do not see an option under API execution pane to configure caching for any endpoint or the resource. The option we get there is to enable caching for any query, path parameters and headers. Those configuration are only to enable caching by params. Which means if you expect GET /products/1111 to be different than GET /products/1112. Anyway, the option to enable caching is only under the stage settings and then you go to individual endpoint under the stage to override the caching option (the overriding the caching becomes available only after enabling caching at the stage level)
We are unable to do caching with above solution in API Gateway, please suggest the way to enable caching in API Gateway. the navigations that are provided are not working.