AWS API Gateway: Optimizing Latency for Your API Requests

Ensure Minimum Latency for Your AWS API Gateway Requests

Prev Question Next Question

Question

Your team has just deployed an API behind the AWS API gateway service.

They want to ensure minimum latency of requests to the API gateway service.

Which of the following feature can help fulfill this requirement?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Answer - B.

This is mentioned in the AWS Documentation.

You can enable API caching in Amazon API Gateway to cache your endpoint's responses.

With caching, you can reduce the number of calls made to your endpoint and also improve the latency of requests to your API.

When you enable caching for a stage, API Gateway caches responses from your endpoint for a specified time-to-live (TTL) period, in seconds.

API Gateway then responds to the request by looking up the endpoint response from the cache instead of requesting your endpoint.

The default TTL value for API caching is 300 seconds.

The maximum TTL value is 3600 seconds.

TTL=0 means caching is disabled.

Option A is incorrect since this is used to help debug issues related to API request latency.

Option C is incorrect since it allows API resources to receive requests from a domain other than the API's own domain.

Option D is incorrect since this is used to control access to your API methods.

For more information on API gateway cache, please visit the following URL-

https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html

B. Use API caching.

API caching can help reduce the latency of requests to the API gateway service by caching responses for a specified period of time. This means that if a client makes a request for the same resource within the caching period, the API gateway can return the cached response instead of making another request to the backend service. This can significantly reduce the response time and the load on the backend service.

A. Setup X-Ray tracing.

X-Ray tracing can help diagnose and troubleshoot issues with the API gateway service by providing end-to-end visibility into the requests and the services they interact with. However, setting up X-Ray tracing alone may not necessarily improve the latency of requests to the API gateway service.

C. Enable CORS.

Enabling CORS (Cross-Origin Resource Sharing) allows clients to make cross-origin requests to the API gateway service, but it does not directly impact the latency of requests.

D. Use Lambda Authorizers.

Lambda authorizers can be used to authenticate and authorize requests to the API gateway service using AWS Lambda functions. However, using Lambda authorizers alone may not necessarily improve the latency of requests to the API gateway service.

Therefore, the correct answer is B. Use API caching, as it directly impacts the latency of requests to the API gateway service.