CloudFront with S3 website as origin is not serving gzipped files

前端 未结 2 1977
野的像风
野的像风 2020-12-14 07:14

AWS now supports gzipping files through CloudFront

I\'ve followed along with all of the instructions in Serving Compressed Files, and yet gzipping is not working.

2条回答
  •  孤城傲影
    2020-12-14 07:37

    My problem was that I uploaded the files specifically with utf-8 encoding. From the documentation:

    CloudFront determines whether the file is compressible:

    The file must be of a type that CloudFront compresses.

    The file size must be between 1,000 and 10,000,000 bytes.

    The response must include a Content-Length header so CloudFront can determine whether the size of the file is in the range that CloudFront compresses. If the Content-Length header is missing, CloudFront won't compress the file.

    The response must not include a Content-Encoding header.

提交回复
热议问题