News for hackers. Stuff that matters.
Re:3 Problems AWS Needs to Address by ComputerGuru on Wednesday May 09, 2012 @04:11AM (#3947549)
It's a little-known fact that CloudFront supports GZip just fine, so long as you're using pull from custom origin (like most people are).

You just need to configure your origin servers to serve GZip even to HTTP 1.0 (which is what CF requests will come as) and set the "Vary: Accept-Encoding" header to prevent users of old IE versions from having GZip'd content they don't support stuffed down their throats.

For example, this is my nginx configuration which serves both GZip'd and non-GZip'd versions of the same objects via CF. The second and third lines are the most important for correct AWS CF GZip distribution:

    gzip  on;
    gzip_vary on;
    gzip_http_version 1.0;
    gzip_comp_level 4;
    gzip_proxied any;
    gzip_types      text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript image/png;
    gzip_disable    "MSIE [1-6]\.";
Note that "image/png" is only in there because Google PageSpeed is very stupid and marks not GZipping PNG files as a "bug" because I can save "up to 1%" by employing GZip on PNGs.
Re:3 Problems AWS Needs to Address by TazeTSchnitzel on Wednesday May 09, 2012 @05:33AM (#3947743)
>gzipping format that uses deflate compression

ಠ_ಠ

Re:3 Problems AWS Needs to Address by nphase on Wednesday May 09, 2012 @10:14AM (#3948636)
This isn't reddit. Please reply with a helpful comment describing why this is/isn't the right way to do things.

(http://stackoverflow.com/questions/388595/why-use-deflate-in...)

Re:3 Problems AWS Needs to Address by TazeTSchnitzel on Wednesday May 09, 2012 @12:01PM (#3949151)
Sorry, I made assumptions that people knew what gzip was. EDIT: That wasn't meant to be condescending, I apologise.

To clarify the original comment: I think it's rather pointless to gzip a PNG file, since PNG files use deflate compression, the same method gzip uses, and hence it has very little real benefit, if any.

Re:3 Problems AWS Needs to Address by Terretta on Wednesday May 09, 2012 @12:59PM (#3949436)
Your look of disapproval seems to have overlooked why he said he was using it. He's clearly aware of your point, and even mentioned the uselessness: "Up to 1% savings" while explaining why: Google Page Speed is stupid.
Re:3 Problems AWS Needs to Address by TazeTSchnitzel on Wednesday May 09, 2012 @01:15PM (#3949508)
Yes, I was pointing out the stupidity of that further because you're compressing something twice.
Re:3 Problems AWS Needs to Address by tingletech on Wednesday May 09, 2012 @10:43AM (#3948788)
Why do people always say "this is not reddit"? I never even heard of reddit till I saw those comments. And I think this observation made over and over again usually adds less to the discussion than the politically incorrect statements this comment is made in response to.

Also, I don't think your link relates the the comment. Your link is about choosing between gzip and deflate; the comment you found objectionable was about the irony of gzipping a file that is in a format that also support deflate (so you might compress a compressed file; which I think can actually make the file larger).

Re:3 Problems AWS Needs to Address by Travis on Wednesday May 09, 2012 @03:44PM (#3950145)
Many on HN were once / still are redditors. Especially proggit. The type of response where you quote part of the parent, don't add any comment or commentary, isn't especially helpful.

Addressing your second point: I also thought the comment was a snarky reply, wondering why someone would use gzip instead of deflate. The parent comment addressed, specifically, why they were using gzip on PNG, which is why I assumed the 3 character response was focused on the compression type, rather than whether to use it on PNGs.