Live data from Hacker News

The Fastest Blog in the World

jacquesmattheij.com

111–120 of 130 posts

Re: The Fastest Blog in the World

#112
post #110
post #27

Earlier quoted context omitted.

While I agree with your comment about Google, I disagree with this one: > If the only change is that it loads faster, and he doesn't grow his audience, then he hasn't really achieved anything. If this makes his readers happier, it is a success nonetheless. Maybe this is a startup/HN thing that everything must grow and grow. But that isn't the only successful strategy, even from a purely economic point of view. If you…

load time is not a success factor in and of itself. Fast load times for bad content will not lead to success as little as really great content with horrible load times. But that being said, I am a proponent of significantly prioritizing load times over everything else. Load time should be a constant multiplier in decisions. If a "great feature" significantly taxes load time it needs to either die or be optimized.

[deleted]

Re: The Fastest Blog in the World

#113
post #15

Mine is faster :) https://github.com/kaihendry/natalian X1C3:~$ httping http://natalian.org PING natalian.org:80 (/): connected to 54.192.159.125:80 (147 bytes), seq=0 time= 91.36 ms connected to 54.192.159.123:80 (147 bytes), seq=1 time= 28.63 ms ^CGot signal 2 --- http://natalian.org/ ping statistics --- 2 connects, 2 ok, 0.00% failed, time 1394ms round-trip min/avg/max = 28.6/60.0/91.4 ms X1C3:~$ httping http://ja…

I'm pretty far away from you, you have to discount for the network. Pretty good though, I think if you inline the CSS you'll win hands down :)

Is there that much of a difference between that and telling the browser to download and cache a common CSS file for the site? Assuming the common CSS doesn't have a lot of cruft in it.

Re: The Fastest Blog in the World

#114
post #6

doesn't inlining the CSS make the page require more data in the long run? Especially if you're not changing it often Browser caches solve a lot of things for us. Though you're still parsing a bunch of JS, google's front page is "only" fetching 56kb Granted, this blog post is 13.5kb, but it doesn't have an entire search app embedded into it (with the whole search results automatically appearing thing, I imagine that i…

As a data point: I skimmed the article once, clicked no links, and will likely never go to that site again in the next month. Browser caching won't help me.

Re: The Fastest Blog in the World

#115

Earlier quoted context omitted.

Here's a crude starting point: html,body { margin: 0, width: 100%; } body, input { font-family: Verdana, sans-serif; font-size: 1.2em; line-height: 1.4em; } form { margin: 20% auto; width: 26em; }

bookmarking the following works as well: data:text/html,%20%20%20%20%3Chtml%3E%0A%20%20%20%20%20%20%20%20%3Chead%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3Cstyle%20type%3D%22text%2Fcss%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20html%2Cbody%20%7B%20margin%3A%200%2C%20width%3A%20100%25%3B%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20body%2C%20input%20%7B%20font-family%3A%20Verdana%2C%20sans-ser…

Why not omit the spaces and newlines:

    data:text/html,%3Chtml%3E%3Chead%3E%3Cstyle%20type%3D%22text%2Fcss%22%3Ehtml%2Cbody%20%7B%20margin%3A%200%2C%20width%3A%20100%25%3B%20%7Dbody%2C%20input%20%7B%20font-family%3A%20Verdana%2C%20sans-serif%3B%20font-size%3A%201.2em%3B%20line-height%3A%201.4em%3B%20%7Dform%20%7B%20margin%3A%2020%25%20auto%3B%20width%3A%2026em%3B%20%7D%3C%2Fstyle%3E%3C%2Fhead%3E%3Cbody%3E%3Cform%20action%3D%22https%3A%2F%2Fwww.google.com%2Fsearch%22%20method%3D%22get%22%3E%3Cinput%20type%3D%22text%22%20name%3D%22q%22%20placeholder%3D%22search%22%20size%3D%2230%22%3E%3Cinput%20type%3D%22submit%22%20value%3D%22google%22%3E%3C%2Fform%3E%3C%2Fbody%3E%3C%2Fhtml%3E

Re: The Fastest Blog in the World

#116

Earlier quoted context omitted.

There is a small penalty but it does not seem to weigh up against the advantage of having all the data in one shot even on first page view on that site. Total overhead of the CSS 'in flight' is about 6.6K, versus doing another request which would require another round-trip to the server. Inlining the CSS was considerably faster in all my tests.

How much of that win was only on the first time a page from your site is requested? I'd expect in-lining the css to be a slight net loss once the data is cached - my strategy would be a `style- .css` with a long max-age. I wish browsers could cache page fragments!

[deleted]

Re: The Fastest Blog in the World

#117
post #87

> I’m sure I can do better still, for instance the CSS block is still quite large (too many rules, not minified yet) CSS doesn't minify particularly well since the class names, tag names, and attributes all have to stay in their full form. Basically it just ends up being removing extraneous whitespace. However, ever since reading James Hague's post on "Extreme Formatting"[0], I've rather liked CSS without all the ext…

But if everything that could possibly reference a class or tag or attribute is inlined into the same file then you know exactly what the scope of your CSS is for that particular request. So it should be possible to minify even the names.

I'm not sure that would gain much, what with the compression that's ordinarily done anyways.

Re: The Fastest Blog in the World

#118

You could also uglify your CSS and HTML by removing redundant whitespace and newlines

I'll have a look to see what the differences are, gzip is already enabled so it might be less than on a site that sends all the data in plaintext over the wire.

Also, you could cut down the size slightly by shrinking div names. Sure, with gzip "aside.sidebar" isn't going to take much extra space, but it will take some.

(That being said, please don't do this. Minified JS is bad enough.)

Re: The Fastest Blog in the World

#119

Earlier quoted context omitted.

I'll have a look to see what the differences are, gzip is already enabled so it might be less than on a site that sends all the data in plaintext over the wire.

Also, you could cut down the size slightly by shrinking div names. Sure, with gzip "aside.sidebar" isn't going to take much extra space, but it will take some. (That being said, please don't do this. Minified JS is bad enough.)

I think I'm pretty close to the 'sweet spot' where further optimizations are both a waste of time and make the result much less useful in the longer term. But just for the sake of research I'm more than willing to play around to see what happens.

Re: The Fastest Blog in the World

#120

Earlier quoted context omitted.

How much of that win was only on the first time a page from your site is requested? I'd expect in-lining the css to be a slight net loss once the data is cached - my strategy would be a `style- .css` with a long max-age. I wish browsers could cache page fragments!

> I'd expect in-lining the css to be a slight net loss once the data is cached I expected that too but it didn't work out that way. I'm not sure why, possibly a cache lookup is still slower than reading the style info out of the same page. I don't know enough about the guts of a modern browser to make the call but the numbers aren't there.

In chrome, I'm getting extremely similar times for the two approaches without caching (I am in-network, so my roundtrips are ~1ms). With the style.css fully cached, I'm getting ~15ms faster on the sideband approach than with inline styles.

Can you expose your methodology, or are you using a common tool for testing these things?

Post reply on HN