Skip to content
Lambda@Edge for serving Brotli or Gzipped file according to the Accept-Encoding header
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE
README.md
index.js
package.json

README.md

lambda-edge-serve-compressed-file

Lambda@Edge for serving Brotli or Gzipped file according to the Content-Encoding header. It supports CSS and JS files.

Requirements

  1. Use S3 && Cloudfront
  2. You MUST upload your CSS & JS files already compressed to the bucked. In other words, you MUST upload the same file three times: without compression, compressed with Brotli (and .br extension), compressed with Gzip (and .gzip compression).
  3. You MUST deactivate gzip on-the-fly compression from CloudFront settings.
  4. Use this Lambda@Edge in order to intercept Requests for CloudFront.

Useful resources: Get Lambda Event Source Gist

You can’t perform that action at this time.