简体   繁体   中英

Cloudfront Gzip compression not working with files on site

I have enabled gzip page compression via Cloudfront on my behaviors. I have whitelisted the following headers:

Authorization
Host
Origin
Referer

The file in question is not being gzipped by Cloudfront. Here are the Request and Response Headers.

Why is the gzip not working? The headers have gzip and content-length values so that's the requirement from cloudfront as far as I understand.

Request Header

Accept  text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8

Accept-Encoding gzip, deflate, sdch

Accept-Language en-US,en;q=0.8

Cookie  SESSef4017ccd367c98fbaadc=56e41ddb0fc0e0235cf8c5f7f18;
_ga=GA1.2.1714162874.1474376389;

has_js=1

Upgrade-Insecure-Requests   1

User-Agent  Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36


Response Header

Accept-Ranges   bytes

Age 25

Cache-Control   max-age=172800

Content-Length  614

Content-Type    text/css

Date    Wed, 21 Sep 2016 16:04:28 GMT

Expires Fri, 23 Sep 2016 16:04:28 GMT

Last-Modified   Wed, 16 Jan 2013 21:09:10 GMT

Server  Apache

Via 1.1 xxxx.cloudfront.net (CloudFront)

X-Amz-Cf-Id xxxxxxxxxxZ3lir8aOV5mykyezionEw==

X-Cache Hit from cloudfront

Hi the file size above which cloudfront will gzip is 1000 bytes. so a few of my .css files were below that hence gzip wasn't happening. Gzip via cloudfront works now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM