Data Operations and Support

An Amazon API Gateway REST API caches GET responses, but requests with different region query parameters receive the same cached dataset. The backend returns correct region-specific data when caching is disabled; which change preserves caching and fixes the responses?

Show the answer

Correct answerC. Include the region query parameter in the cache key.

AWhy not this: A shorter TTL does not distinguish regions, so requests can still receive another region's cached response.

BWhy not this: Usage-plan throttles control request rates, not which parameters distinguish cached responses.

CWhy this is right: Including region in the cache key separates cached responses for requests that need different datasets.

DWhy not this: Additional cache capacity stores more entries but does not change how requests map to entries.

A cache key must distinguish requests whose responses differ. Including region creates separate cached entries for each region; reducing the TTL only shortens how long an incorrectly shared response remains cached.