Free tools Windows power users keep installed
One-click scans. No signup required.
Amazon API Gateway can cache responses to a REST API’s POST method, but it does not do so automatically. Enable the stage cache, explicitly turn on caching for the POST method, and choose a stable cache key from supported request parameters. Because API Gateway’s documented cache keys do not include the request body, this works only when those parameters adequately distinguish responses.
How POST caching works in API Gateway
API Gateway caching stores endpoint responses so later requests with the same cache-key values can be served without calling the integration. When caching is enabled for a stage, only GET methods have caching enabled by default; POST needs a method-level override. AWS describes caching as best-effort, not a guarantee that every request will be served from cache. AWS API Gateway caching documentation.
For POST, the decisive design issue is whether the chosen key captures every input that can change the response. AWS documents custom headers, URL paths, and query strings as cache-key sources, with separate entries for different key values. Its documentation does not identify the POST body as a cache-key parameter. If two POST bodies can produce different responses while the supported key parameters remain identical, caching those responses under that key can return the wrong result. Add a suitable documented key parameter to the request design, or use a different caching layer.
Enable caching for a POST method
- Provision a cache cluster for the stage. In the API Gateway console, open the REST API, choose Stages, select the target stage, and enable its cache cluster in the stage settings. Cache creation can take up to four minutes. Cache capacity is charged hourly, and API caching is not eligible for the AWS Free Tier. See AWS cache setup and pricing guidance.
- Enable caching on the POST method. Open Resources, select the resource’s POST method, and edit its method settings to enable caching. A stage cache alone is not sufficient: POST requires an explicit method override. In a stage method-settings configuration, target the method using its resource path and HTTP verb, for example
/orders/POST, and set caching to enabled. Exact console labels can vary as AWS updates the console. - Define the cache key. Configure the relevant method or integration request parameters as cache-key parameters. Use parameters that are stable and that distinguish every response variant users must receive. AWS documents headers, paths, and query strings; each distinct key value is cached separately. Do not assume API Gateway hashes or otherwise includes arbitrary POST bodies.
- Set the time to live (TTL). API Gateway’s default TTL is 300 seconds, the maximum is 3,600 seconds, and a TTL of 0 disables caching. Set it according to how long the response may safely remain stale. These limits and defaults are documented in AWS’s API caching guide.
- Deploy and verify. Deploy the API changes to the intended stage, then send requests with repeated and varied key values. Confirm that expected repeats can be served from cache and that distinct variants do not share an entry.
Choose a cache key that is safe for POST
Before enabling caching, map the response to the request attributes that determine it. If an endpoint accepts a body such as a search filter or report specification, but that body is not represented by a supported key parameter, identical headers, path, and query string can collide even when the bodies differ. A key that is too broad risks incorrect responses; a key with excessive variation may yield few cache hits.
#1 Best Overall
- Your favorite music and content – Play music, audiobooks, and podcasts from Amazon Music, Apple Music, Spotify and others or via Bluetooth throughout your home.
- Alexa is happy to help – Ask Alexa for weather updates and to set hands-free timers, get answers to your questions and even hear jokes. Need a few extra minutes in the morning? Just tap your Echo Dot to snooze your alarm.
- Keep your home comfortable – Control compatible smart home devices with your voice and routines triggered by built-in motion or indoor temperature sensors. Create routines to automatically turn on lights when you walk into a room, or start a fan if the inside temperature goes above your comfort zone.
- Do more with device pairing – Fill your home with music using compatible Echo devices in different rooms, or create a home theatre system with Fire TV.
- Say goodbye to drop-offs and buffering - With eero Built-in, Echo Dot doubles as a mesh wifi extender, adding up to 1,000 sq. ft. of wifi coverage to your existing eero network.
- Use a documented header, path, or query-string parameter to represent each response-changing input.
- Ensure clients supply the key consistently; differences in key values create separate cache entries.
- If the body is the only meaningful discriminator, redesign the request to expose a suitable key parameter or choose a caching approach that can safely key on the body.
- Keep the TTL within the endpoint’s freshness tolerance, especially where underlying data can change independently of requests.
Refresh or invalidate cached responses
Request a refresh for an entry
A client can send Cache-Control: max-age=0 to request that an existing entry be refreshed from the integration. Teams can require the execute-api:InvalidateCache IAM permission for clients allowed to request invalidation. How an unauthorized request is handled depends on the API’s configured policy. Review AWS’s cache invalidation documentation and configure access deliberately rather than treating the header as universally authorized.
Flush the stage cache
Operators can flush the entire cache for a stage using API Gateway’s flush-stage-cache operation. This is broader than refreshing one entry. Following a flush, requests go to the integration until cache entries are rebuilt.
Rank #2
- Your favorite music and content – Play music, audiobooks, and podcasts from Amazon Music, Apple Music, Spotify and others or via Bluetooth throughout your home.
- Alexa is happy to help – Ask Alexa for weather updates and to set hands-free timers, get answers to your questions and even hear jokes. Need a few extra minutes in the morning? Just tap your Echo Dot to snooze your alarm.
- Keep your home comfortable – Control compatible smart home devices with your voice and routines triggered by built-in motion or indoor temperature sensors. Create routines to automatically turn on lights when you walk into a room, or start a fan if the inside temperature goes above your comfort zone.
- Do more with device pairing – Fill your home with music using compatible Echo devices in different rooms, or create a home theatre system with Fire TV.
- Say goodbye to drop-offs and buffering - With eero Built-in, Echo Dot doubles as a mesh wifi extender, adding up to 1,000 sq. ft. of wifi coverage to your existing eero network.
Limits, cost, and operational checks
- Cacheable response size: Responses larger than 1,048,576 bytes cannot be cached, according to AWS’s API caching documentation.
- Provisioning: Creating a stage cache can take up to four minutes.
- Cost: Cache capacity is billed hourly; API caching is not AWS Free Tier eligible. Check current AWS pricing for the relevant region and cache capacity before enabling it.
- Observability: AWS provides the CloudWatch metrics
CacheHitCountandCacheMissCount. Use them to evaluate whether the configured keys and traffic produce useful hits. - Testing: AWS recommends a 10-minute load test that mirrors production traffic and includes both cache-served responses and unique responses. This is a testing recommendation, not a guarantee of a particular hit rate or latency improvement.
There is no universal latency gain or hit rate to expect from POST caching. Results depend on the request-key design, traffic repetition, freshness needs, and integration behavior.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.When another caching layer may fit better
Compare alternatives using the requirements that matter to the endpoint rather than assuming one cache is universally faster or cheaper. In particular, establish whether the layer can safely represent POST bodies in its key, how precisely it can invalidate data, where it is deployed geographically, how much staleness is acceptable, what it exposes for monitoring, its response-size limits, and how it charges. AWS’s API Gateway documentation establishes the API Gateway controls and limits above, but does not establish a universal cross-product benchmark.
Recommended Free Tools
Quick Recap
Best Value
- MEET ECHO SPOT - A sleek smart alarm clock with Alexa and big vibrant sound. Ready to help you wake up, wind down, and so much more.
- CUSTOMIZABLE SMART CLOCK - See time, weather, and song titles at a glance, control smart home devices, and more. Personalize your display with your favorite clock face and fun colors.
- BIG VIBRANT SOUND - Enjoy rich sound with clear vocals and deep bass. Just ask Alexa to play music, podcasts, and audiobooks. See song titles and touch to control your music.
- EASE INTO THE DAY - Set up an Alexa routine that gently wakes you with music and gradual light. Glance at the time, check reminders, or ask Alexa for weather updates.
- KEEP YOUR HOME COMFORTABLE - Control compatible smart home devices. Just ask Alexa to turn on lights or touch the screen to dim. Create routines that use motion detection to turn down the thermostat as you head out or open the blinds when you walk into a room.
Rank #4
- Your favorite music and content – Play music, audiobooks, and podcasts from Amazon Music, Apple Music, Spotify and others or via Bluetooth throughout your home.
- Alexa is happy to help – Ask Alexa for weather updates and to set hands-free timers, get answers to your questions and even hear jokes. Need a few extra minutes in the morning? Just tap your Echo Dot to snooze your alarm.
- Keep your home comfortable – Control compatible smart home devices with your voice and routines triggered by built-in motion or indoor temperature sensors. Create routines to automatically turn on lights when you walk into a room, or start a fan if the inside temperature goes above your comfort zone.
- Do more with device pairing – Fill your home with music using compatible Echo devices in different rooms, or create a home theatre system with Fire TV.
- Say goodbye to drop-offs and buffering - With eero Built-in, Echo Dot doubles as a mesh wifi extender, adding up to 1,000 sq. ft. of wifi coverage to your existing eero network.
Rank #3
- Meet Echo Dot Max: Experience rich room-filling sound that automatically adapts to your space and fine-tunes playback. Features a built-in smart home hub and Omnisense technology for highly personalized experiences.
- Music to your ears: With nearly 3x the bass versus Echo Dot (2022 release), it fits beautifully in any space, delivering your personal sound stage with deep bass and enhanced clarity. Listen to streaming services, such as Amazon Music, Apple Music, Spotify, and SiriusXM. Encore!
- Do more with device pairing: Connect compatible Echo smart speakers and smart displays in different rooms, or pair with a second Echo Dot Max to enjoy even richer sound. Pair your Echo Dot Max with compatible Fire TV devices to create a home theater system that brings scenes to life.
- Simple smart home control: Set routines, pair and control lights, locks, and thousands of smart home devices that work with Alexa without needing a separate smart home hub. With Omnisense technology, you can activate routines via temperature or presence detection.
- Say goodbye to drop-offs and buffering - With eero Built-in, Echo Dot Max doubles as a mesh wifi extender, adding up to 1,000 sq. ft. of wifi coverage to your existing eero network.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

