leftclickben / serverless-api-stage

AWS API Gateway stage plugin for serverless framework
MIT License
47 stars 16 forks source link

feat(caching): add caching ability #5

Closed e0ipso closed 6 years ago

e0ipso commented 6 years ago

This PR will add the ability to enable caching for API Gateway.

To do so add:

custom:
  # …
  stageSettings:
    CacheClusterEnabled: true
    CacheClusterSize: '0.5'
    MethodSettings:
      CachingEnabled: true
      CacheTtlInSeconds: 3600

See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html\#cfn-apigateway-stage-cacheclusterenabled form more info.

fantapop commented 6 years ago

Does this include the ability to specify which query parameters are cached?

e0ipso commented 6 years ago

Sadly, no. That's because this ability is specified in the API Gateway method layer, not the API Gateway stage.

e0ipso commented 6 years ago

@leftclickben I also fixed a problem with the way we are getting the stage and region information in the CF template builder.

leftclickben commented 6 years ago

Excellent, thanks @e0ipso :+1:

e0ipso commented 6 years ago

Thanks @leftclickben. Do you think you could tag a minor release with these changes?

leftclickben commented 6 years ago

@e0ipso Oops, sorry! Done now :-)