serverless-content-compression
Serverless plugin that enables/disables content compression setting in API Gateway
Why
Currently Serverless Framework does not support MinimumCompressionSize
settings.
Existing plugin serverless-content-encoding implementation is not optimal and causing "Too Many requests" error.
How to use
-
npm install --save-dev serverless-api-compression
-
Add plugin to your
serverless.yml
config
plugins:
- serverless-api-compression
- Add
contentCompression
attribute to yourcustom
section
custom:
contentCompression: 1024
contentCompression
value is a MinimumCompressionSize in bytes. Use 0
to enable compression for all responses.
Use null
or false
to disable it.