Serverless Content Encoding

homepage icon https://github.com/dong-dohai/serverless-content-encoding
Follow @dong-dohai

Tracked

NPM Downloads Last Month
4868
Issues
0
Stars
11
Forks
1
Watchers
11
Watch Star Fork Issue Download License NPM Build Status Coverage Status Contributors

Repo README Contents:

Serverless Content Encoding

A serverless plugin to enable Content Encoding feature in API Gateway for lambda function response compression.

Install

Using yarn:

$ yarn add -D serverless-content-encoding

Using npm:

$ npm install --save-dev serverless-content-encoding

Configuration

Add the plugin and its configuration to your serverless.yml file:

plugins:
  - serverless-content-encoding

custom:
  contentEncoding:
    minimumCompressionSize: 0 # Minimum body size required for compression in bytes

This plugin will be triggered during deployment process

$ serverless deploy

Note

This plugin is to enable Content Encoding on API Gateway for response compression. If your are looking for binary files support, please use serverless-apigw-binary

Thanks @evgenykireev for the recommendation of using MinimumCompressionSize in CloudFormation instead of CreateDeployment API