Hacker News new | past | comments | ask | show | jobs | submit login
John Resig's CSS optimization for F7U12 SubReddit (more than 6x improvement) (reddit.com)
151 points by DanielRibeiro on April 25, 2011 | hide | past | favorite | 25 comments



Hah, very nice! I'll make sure this gets implemented. I'm sort of kicking myself for not doing it myself, but I just never noticed that images were loaded again on each request...


Incorrect headline, Reddit already utilises CSS sprites: http://www.reddit.com/static/sprite.png?v=0ec7f79c9f54824fde...

Headline should be: "John Resig's CSS optimization for Reddit's subreddit of fffffffuuuuuuuuuuuu (more than 6x improvement)"


CSS sprites wasn't the issue anyway. It was an interaction between the way the CSS referenced images and reddit's overzealous optimisations for its CDN turning every reference into a unique one.


Note it's an improvement for a particular sub-reddit.

Edit: nice, someone fixed the title.


After reading it, it only improves a certain subreddit by 6x. It doesn't actually change much for the overall site besides the fu subreddit.


Other subreddits aren't so image-heavy, and thus already load fast.


Running Yslow or pagespeed on the site would have turned up the same thing. Not to diminish John's effort, but it's really not black magic.


Do other subreddits use custom icons that would benefit with a similar optimization not just f7u12? I think there are a few.


Yep. Quite a few use those same rage faces. Reddit really ought to just implement that themselves and let subreddit mods turn it on or off, since they're getting so popular.


Yeah, this is a nice improvement. You can see it in detail with a tool like Slowcop (the identical resources loading): http://slowcop.com/reports/4db4dd3e728daf5e96000007/reddit-c...


Please fix your title.

EDIT: Thanks.


Fixed. I am usually against long titles, but if the community prefer a more specific, albeit longer, title, so be it.


It's not a matter of specificity, it's a matter of inaccuracy.


Ok. I really appreciate the feedback. Hope it is better now.


Ah, nice, so a notable open source author of a massively successful frontend library fixes a bug that's obvious to any frontend developer worth their salt.

It's nice, but news? Really?


Out of all the pretentious "this isn't Hacker News" comments, this is the most ridiculous example I've seen. If this isn't Hacker News, what is?


Honestly? On the front page:

Magical Block Store: Why EBS Can't Work -- http://news.ycombinator.com/item?id=2479613

Russia's Crime of the Century -- http://news.ycombinator.com/item?id=2479865

How many zeros are there in 2^n? -- http://news.ycombinator.com/item?id=2479129

The difference is that those posts link to content which shows you something interesting. As a consequence, two of them have interesting comments, too (the political one can be excused.) It's hard for me to understand what is interesting about John Resig fixing a relatively boring CSS performance bug, but I guess that's why we all have our own vote button.


I completely agree here. Hacker News has become a reddit cesspool over the last year and the types of posts popular on reddit seem to make it over here. I will leave this community in a year because I am sure the two communities will begin to mimic each other too much.

If it wasn't John Resig who "fixed" the subreddit, then this would be lost in the thousands of pointless posts. I hardly find this something worth of HN.


But this isn't an optimization that I can learn from, really. I mean, unless I made that same mistake in referencing my sprite images, which seems unlikely. Basically, look at firebug and see what all the connections are coming from and fix it.


That isn't the test for whether something is Hacker News-worthy though?

However a notable developer hit a problem on a well-known site, diagnosed, proposed and explained a solution, and did it in a friendly, humorous way.

So there are a few lessons there on how hackers can conduct themselves in a positive manner in online communities.


Maybe I would have appreciated the article better if the title hadn't said "CSS optimization". That made me expect to find some secret to help me make CSS load or render faster. He really fixed a bug in the use of a CSS sprite file.

More interesting: someone finds a way to find other instances of sprite files being used incorrectly on a given domain. But I think Google PageSpeed would identify this for accessing a static file with query string.


If I wanted to read about basic CSS spriting techniques/benefits, I'd go read one of the endless reposts on A List Apart, Smashing Magazine or SitePoint (or one of the hundreds of other sites). I'd throw down solid cash on a bet that the people who come to HN come here because the type of content you'll find here is generally far above that level, and there is absolutely nothing wrong with demanding quality submissions.

We all know John is a great guy and a kickass developer, this doesn't need to be re-stated for the umpteenth time. If you'd like, though, I can happily start submitting every article on basic web design techniques I come across though. Seems like it's right up your alley, no? =)


I think its nice in that its a great example of someone having so much passion for what they do that even something as trivial as this fix is to them worth the time to remedy.


The point is that it's really cool that some developer took the time to clean up part of the internet that is largely orthogonal to his life.

That's respectable, right?

If he put this in a blog post instead of a Reddit comment, would you still be complaining?


Yeah, because it's not about the fact that it was done on Reddit, it's the fact that this just isn't news to most people here. This is easily one of the most basic web design techniques pushed today, and what he fixed is so espoused in the basics of frontend performance that I'm shocked people consider this news.

John's a great dev and a nice guy who just fixed a subreddit. I don't see it as news if he makes an incredibly basic change to an arbitrary site, though - I follow him on Twitter for this kind of information. ;)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: