1

I have done compression on my origin server for static content. But when I request any content I am not getting compress content.

Response Header should show accept-encoding.

Below I pasted my Request and Response Header

Response Header

Accept-Ranges   bytes
Access-Control-Allow-Orig...    *
Age 66882
Cache-Control   max-age=86401,Public, private
Connection  keep-alive
Content-Length  672360
Content-Type    application/x-javascript
Date    Tue, 17 Feb 2015 12:51:03 GMT
Etag    "201:0"
Last-Modified   Tue, 10 Feb 2015 10:55:41 GMT
Server  Microsoft-IIS/7.5
Via 1.1 e5ac6dd.cloudfront.net (CloudFront)
X-Amz-Cf-Id fg_yEVDpepF4e0Uk_y0Z-aZ801X1aA==
X-Cache Hit from cloudfront

Request Header

Accept  text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding gzip
Accept-Language en-US,en;q=0.5
Cache-Control   no-cache
Connection  keep-alive
Host    d18m3f4yg8acci.cloudfront.net
Pragma  no-cache
User-Agent  Mozilla/5.0 (Windows NT 6.3; WOW64; rv:36.0) Gecko/20100101 Firefox/36.0

Thanks Prmechand

udondan
  • 57,263
  • 20
  • 190
  • 175
  • 1
    Note the `Age: 66882` ... this is a cached response from Cloudfront, from 18.5 hours prior to the time you requested it. Was this, perhaps, before you made the configuration change? But also... `Accept-Encoding:` is only a request header, isn't it? – Michael - sqlbot Feb 19 '15 at 17:30

1 Answers1

1

The problem your seeing is due to IIS dropping gzip compression due to the presence of a 'Via' header (it assumes not all proxies can cope with compressed content).

I've answered this question, and provided a fix here (although the asker hasn't got round to marking it as accepted).

Amazon EC2 serves gzipped JavaScript. But Cloudfront does not. Why?

Community
  • 1
  • 1
Mark Kelly
  • 553
  • 4
  • 13