Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Gateway should be set to regional instead of edge-optimized #39

Open
corollari opened this issue Jun 14, 2020 · 0 comments
Open

API Gateway should be set to regional instead of edge-optimized #39

corollari opened this issue Jun 14, 2020 · 0 comments

Comments

@corollari
Copy link

By default the API gateway generated by serverless is set to be edge optimized, meaning that, if a cloudfront distribution is added on top of that, api requests will hit cloudfront nodes twice:

Client -> CloudFront distribution (this plugin) -> CloudFront distribution (Edge optimized API gateway) -> API Gateway -> Lambda

This increases the latency of responses and mangles several cloudfront headers such as CloudFront-Viewer-Country, making them useless (see https://stackoverflow.com/questions/46490508/api-gateway-caching-vs-cloudfront).

To fix this, this plugin should change the api gateway resources to be regional instead of edge-optimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant