Answer: D
A client of your API can invalidate an existing cache entry and reload it from the integration endpoint for individual requests. The client must send a request that contains the
Cache-Control: max-age=0
header. The client receives the response directly from the integration endpoint instead of the cache, provided that the client is authorized to do so. This replaces the existing cache entry with the new response, which is fetched from the integration endpoint.
Option A is incorrect as flushing the entire cache will not help solve latency problems. All requests will be forwarded to the integration backend until the cache has been refilled.
Option B is incorrect as disabling caching all together will not reduce latency as all requests will be forwarded to the integration backend.
Option C is incorrect because setting a value of TTL=0 actually means that you are disabling the cache.
Option D is CORRECT because if authorized users invalidate the cache, the latency of the API can be reduced. If you don`t impose an
InvalidateCache
policy (or choose the Require authorization check box in the console), any client can invalidate the API cache. If most or all of the clients invalidate the API cache, this could significantly increase the latency of your API.
Reference:
https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html