API Gateway
Nov 5, 2022
# API Gateway
# WebSockets
- As a heads up as well to anyone doing IoT-related things. AWS API Gateway has a max connection time for WebSockets of 2 hours. This may be a hard stop for some.
- AWS SAM support for API Gateway local Websockets API testing is
literally non-existent. This means you have to have a test server in order to test your application, but I guess that’s fine.
- Hard stop if you need
broadcasting functionality that scales
- Throttling Limits: API Gateway provides throttling at multiple levels including global and by service call. Throttling limits can be set for standard rates and bursts. API Gateway tracks the number of requests per second. Any requests over the limit will receive a 429 HTTP response. The client SDKs generated by API Gateway retry calls automatically when met with this response.
- API owners can set a rate limit of 1,000 requests per second for a specific method in their REST APIs, also configure Amazon API Gateway to handle a burst of 2,000 requests per second for a few seconds. Any requests over the limit will receive a 429 response.
- You can add caching to API calls by provisioning an Amazon API Gateway cache and specifying its size in gigabytes. The cache is provisioned for a specific stage of your APIs. This improves performance and reduces the traffic sent to your back end. Cache settings allow you to control the way the cache key is built and the time-to-live (TTL) of the data stored for each method. API Gateway also exposes management APIs that help you invalidate the cache for each stage.