繁体   English   中英

Cloudfront Gzip压缩不适用于站点上的文件

[英]Cloudfront Gzip compression not working with files on site

我已经通过Cloudfront在我的行为上启用了gzip页面压缩。 我已将以下标头列入白名单:

Authorization
Host
Origin
Referer

有问题的文件未被Cloudfront压缩。 这是请求和响应头。

为什么gzip不起作用? 标头具有gzip和content-length值,据我所知,这是cloudfront的要求。

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

嗨,cloudfront gzip上面的文件大小为1000字节。 所以我的一些.css文件低于该文件,因此不会发生gzip。 通过Cloudfront的Gzip现在可以使用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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