Hacker News new | ask | show | jobs
by thresh 2744 days ago
It's all fun and games until we realize our web designers put a four megabyte jpeg on the index page.
4 comments

What, JPEG? I thought real designers prefer high quality content and use 20 megabyte PNGs. (been there, done that)
I think this is a really good point. While I like the article's focus on depth, and thinking about the small stuff is important, saving a few bytes on headers is going to be blown out of the water by all the images, JS, CSS, and 3rd-party pixels being loaded. "Profile before optimizing" applies here too.
1. Images are transferred once, not with every request.

2. Most requests and many responses are all or mostly headers.

3. Intermediaries.

4. Header compression is at the protocol level; if it's done wrong, the best js/css/whatever policy can't do anything to improve it.

But I bet you most people will never profile this.

We have a tendency to focus on page size but what really matters is the user experience.

For all the advice of putting making sure the first 15KB of a page counts, inlining critical styles etc., it that response has 4KB of headers e.g. large cookies, then all of a sudden you've got 11KB!

The 4 MB JPEG would be downloaded, though, while the headers would be uploaded. Consumer internet has terrible upload speeds in general.
Given today's screen resolution, anything less would probably look horrible.
Use SVG. Infinite detail. Doesn't work for photos though.