Skip to content

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

Description

@corollari

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions