4 ms·
If anyone could enlighten me as to why this is I would really appreciate it EDIT: My question was in reference to the latter part of the final conclusion, Chro
by thomseddon 14y ago
If anyone could enlighten me as to why this is I would really appreciate it
EDIT: My question was in reference to the latter part of the final conclusion, Chrome sends:
Accept:/
Accept-Encoding:gzip,deflate,sdch
But doesn't actually support it.
Thanks to hobbit_longon for help pointing out the error in the final point.
- hobbit_longon 14y agoIs this a joke? You want to know why people don't gzip their images? What benefit do you think you get from gziping a jpeg or png stream? Why were you trying it in the first place?
- nodata 14y ago(I think he asked to boost the comment ranking for his submission.)
- thomseddon 14y agoI think you may have misunderstood the conclusion of the article and so hence my question: When requesting an image chrome sends: Accept:/ Accept-Encoding:gzip,deflate,sdch But if you abide by this and send it gzip'ed it fails...why?
- hobbit_longon 14y agoI'm not misunderstanding anything. Your very last point contains: "We still don’t quite understand why nobody sends gzip’ed images"
- thomseddon 14y agoQuite right, I have corrected that part of the conclusion, my question referred to the latter part, which I paraphrased above.
- hobbit_longon 14y agoYeah I was right, bitch.
- markhemmings 14y agoGood question. Why doesn't chrome decompress it when their header suggests they will? Yes it's unneeded and discouraged, but if developers do send gzipped content such as images (which as we all (including the blogger) know, they definitely shouldn't!) surely chrome should just go ahead and decompress it as normal?
- haldean 14y agoWhen the request is sent Chrome doesn't know the content type of the response, so it can't know that what it's requesting is an already-encrypted file.
- hobbit_longon 14y agoWho said anything about encryption?
- deleted 14y ago[deleted]
- campnic 14y agoTake a moment and compare your response to the other responses here. The other two (at the time of this writing) of them are useful to help someone understand something. The author wrote up his thoughts as a blog post and took the time to submit it looking for help understanding an issue. You were unnecessarily rude and condescending in your response. I'm only bringing this up because your account is new. If you're going to take the time to create an account to reply to a post, why would you create an account just to leave this comment?
- hobbit_longon 14y agoThe OP is demonstrably an idiot. He calls himself "Developer, CEO of The Student Cloud", and yet he apparently has no clue whatsoever about the most basic compression algorithms. Zipping compressed images is something that my mother does.
- ruffmuff 14y agoActually, I think the idiot in the room here is you. Read his response again. The author is asking why, if Chrome does not support gzipped images, it sends "Accept:/ Accept-Encoding:gzip,deflate,sdch" (in other words it states that it will accept any Gzipped content). This is the question no one in this thread is actually answering, instead choosing to nitpick on why the author tried to do something. Also, calling someone an idiot because they lack understanding of a certain field in computer science? Really? Maybe you should lighten up.
- nodata 14y agoIt says on that page why: gzipping un gzippable things either provides no benefit or makes them bigger.
- mmahemoff 14y agoCompressing an already-compressed file can make it bigger due to metainfo and the fact the gzip algorithm isn't optimised as well for images as say, jpeg. Furthermore, it's an unnecessary performance overhead on both server and browser (even regular compression is sometimes undesirable for this reason). I guess the browsers figure it's not worth building in support for a feature that's rarely used and creates a sub-optimal UX.
- andreasvc 14y agoIt's not a matter of optimization. Compression removes redundancy. A compressed file will have very little redundancy, so compressing it again is largely a waste of CPU cycles. This is supported by mathematical principles (cf. information theory).
- colanderman 14y ago> Compressing an already-compressed file can make it bigger due to metainfo That's not why, that's just a reason why doing so is silly. > the gzip algorithm isn't optimised as well for images as say, jpeg. gzip is used in PNG. Read the article; the reason is because he wasn't sending gzip data, just deflate data.
- fschwehn 14y ago@2: well, they just gave you some good reasons not to compress files that already are. they want to save resources. so why don't they unzip compressed files that should not be compressed, though they obviously know how to do it? because nobody would care if they did it!
- rejment 14y agoIt actually DOES support the gzip content encoding for images. I just tested in Chrome 21.
- thomseddon 14y agoDoes it? http://news.ycombinator.com/item?id=4422015 http://news.ycombinator.com/item?id=4422015