HN supports SPDY
spdycheck.org
spdycheck.org
The reason I ask is because every time my Safari crashes, if I have 50 HN tabs open (as I often do on by Friday [1]) I'll get IP banned from HN because Safari will do a GET request on each page, but it can't pass any of the headers necessary to get back a 304, because HN doesn't support it.
[1] The way I consume HN is I load up HN once or twice a day, open up all the interesting links and their comment pages in new tabs, and then go back to work. Then when I have some downtime (most of which is on the weekend) I read through all the open tabs.
Plus, Chrome Sync means I get those free on my mobile too. Nice for when I'm stuck a waiting room or something.
Also, isn't there a whole class of "read it later" type services? Seems a bit much overhead for me.
^ tip, you can drag the padlock/favicon next to the URL right onto/into your "revisit" bookmark folder too, in case you didn't know
An alternate mechanism for the same thing would be to make an HN extension that works more like StumbleUpon: have the browser history function as the "tabs", and just advance through the things you're reviewing (seeing both the HN thread and the original article at once) by clicking either "Save" or "Discard".
And for the too lazy to copy paste: http://tldr.io
You will see 304s for static resources, like images and CSS. Efficiently handling HEAD requests for dynamically generated pages is actually painful, and many frameworks support it by handling the request like a GET and just omitting the body. In our case, most pages contain fnids and will never be the same twice anyway.
And I'm aware of how painful it is to handle HEAD requests for a dynamic page, having had to deal with it on reddit. There are some easy hacks to make it work pretty well. One is to just keep a cache of the last update time of each page, and then use that cache when you get a HEAD request.
I'm not sure what an fnid is, but if you have something on the page that changes so quickly that the hash changes when the content doesn't, then I'd contend you're doing something wrong.
Their specific implementation of continuations means that each time a page is generated, each user-specific/authenticated link off of the page (Flag, Voting, Delete) is evaluated as a possible continuation of the user's state and the user-and-action specific hash "fnid" (Function ID) is cached and interpolated into the HTML.
Hence, the hash absolutely changes for every logged-in user every page load.
Lots of older sites still use continuations to great effect; Continuations were popular in the WebObjects days but since they require lots of user state information to be stored server-side they're comparatively difficult to scale.
Continuations are a really cool pattern to study, since most hacking in HTTP-backed web services comes from the inherently stateless nature of the protocol, and continuation-based programming helps prevent the inverted control flow that page-based programming lends itself to.
I came up with the following simple :-) hack: When there is a need to open a bunch of HN links (either saved tab sessions or more importantly when restoring a crashed browser session), I disconnect the network connection. Once all the tabs are launched, I turn the network connection back on and refresh each tab when i get around to reading it.
By that time most pages are probably updated, so you wouldn’t get any 304s anyway.
Since recent update, Firefox behavior is to only reload restored tabs on demand. This avoids that issue.
https://blog.mozilla.org/blog/2012/06/05/firefox-has-a-redes...
Actually, quite the opposite. HN comment pages seem to peter out at about 12 hours in most cases, and after that you'll rarely see a new comment, so really the content stops changing after about a day.
With this extension, I can open all of the article tabs (skip the comment threads), and jump to the comment thread when needed. It's very much WIP.
I don't know that it's a security flaw in this context, but it's sloppy.
Thanks for letting us know.
Billy Hoffman (founder and CTO @ zoompf)
It is pretty scummy that they charge for IPv6 allocations if you want more than the one address they give you though - I've never seen anyone else doing that - some providers even give you a /56 or /48 free or charge, but Softlayer charges $4 a month for a /64...
It is of course much, much preferred to have a native address. But if you're lazy you can enable IPv6 using 6to4 encapsulation and hope for the best:
modprobe ipv6
MYV4=`ip addr show dev eth0 | grep 'inet ' | awk '{print $2}' | cut -d / -f 1`
MYV6=`printf "2002:%.2x%.2x:%.2x%.2x::1\n" $(echo $MYV4 | tr . ' ')`
ip tunnel add 6to4-ipv6 mode sit remote any local $MYV4 ttl 255
ip link set 6to4-ipv6 up
ip -6 addr add $MYV6/16 dev 6to4-ipv6
ip -6 route add 2000::/3 via ::192.88.99.1 dev 6to4-ipv6 metric 1
echo 'nameserver 2001:470:20::2' >> /etc/resolv.conf
echo "@ IN AAAA $MYV6" >> /your/zone/file.conf
echo "ns1 IN AAAA $MYV6" >> /your/zone/file.conf
echo "www IN AAAA $MYV6" >> /your/zone/file.conf
iptables -A INPUT -i eth0 -p ipv6 -j ACCEPTIt doesn't really need to be a mini-project in your spare time - on some hosts I use, setting up native IPv6 took a few clicks and less than five minutes...
I added IPv6 to an AWS machine using http://tunnelbroker.net - setting it up in Debian literally took five minutes and then adding an AAAA record took another two or three...
I don't think it's difficult to do at all, but the onus on the admin to figure it out (and the fact that IPv4 works just fine) means nobody ends up doing it.
IPv6 is for when you can't get an IPv4 address anymore. To the best of my knowledge, there aren't currently users with only IPv6 addresses, so there's zero reason for us to support it.
In the general case, why should any IPv4 website bother with IPv6? Is there any benefit?
- NATs are full of state, and state is messy. Making your site route around them may improve performance.
- This is one of the few areas where software people can directly make the world a better place, by preventing "our" Internet from regressing into something that more resembles the telco network.
- Lack of IPv6 support strains the credibility of companies that purport to be on the forefront of technology. Google, Facebook, and Wikipedia (and Bing?!) figured this out; why can't Hacker News?
- It gives your site a green 6 in IPvFoo, instead of a red 4. Six is 2 better than four, and green is 100THz better than red.
https://addons.mozilla.org/En-us/firefox/addon/spdy-indicato...
https://chrome.google.com/webstore/detail/spdy-indicator/mpb...
All this when the code is a one-liner:
chrome.extension.sendRequest({ spdy: window.chrome.loadTimes().wasFetchedViaSpdy });
It's not the extension's fault, but Google's. I guess they want us to get used to ignoring the scary permissions?(Also, wouldn't it be good if the Chrome store had a link to the developer / source? All I could find on there was a username 'rauchg')
I like it
* SPDY Multiplexing is superior to HTTP pipelining. Pipelining requires in-order responses, which leads to head of line blocking.
* SPDY header compression is a win for mobile, since mobile uplink bandwidth is often a bottleneck. Request header compression allows for fitting more requests into fewer packets.
* Mobile connections are more likely to hang, so using SPDY PINGs (https://insouciant.org/tech/connection-management-in-chromiu...) will help fail fast.
* Multiplexing more requests over fewer connections will help with mobile power usage (https://insouciant.org/tech/connection-management-in-chromiu...).
If you are going to dedicate resources to switching to SPDY, you should instead investigate protobuf.
* Almost all APIs are transactional. Your API should be returning all the data you need to render a single screen in your mobile app, or it is inefficient.
* You should be stripping all request headers except for User-Agent, and the server should be responding based on the known capabilities of the app version.
* Pings are not the correct way to deal with hangs. I don't want to spill any secret sauce here, but it should be obvious to anyone with low level TCP experience.
* Pipelining also uses a single connection. Opportunistic FINs are not unique to SPDY.
That said, I've got some comments on your new points:
* "Almost all APIs are transactional. Your API should be returning all the data you need to render a single screen in your mobile app, or it is inefficient." - Addressing this completely would take awhile, and there's no good point in our discussing this exhaustively. I'll simply note that while an API response may return all data necessary to render a single screen in the app, it does seem nice to allow for prioritized out of order responses like SPDY does. There does not seem to be a good reason to have head of line blocking in the responses, since the app should be able to render incrementally.
* "Pings are not the correct way to deal with hangs. I don't want to spill any secret sauce here, but it should be obvious to anyone with low level TCP experience." - I think you must be misunderstanding this, or it must not be obvious Google's TCP team, since they agree with the usage of SPDY PINGs. Perhaps you think SPDY PINGs are a keep-alive mechanism? Note that the article I linked to identifies them as a liveness detection mechanism.
* "Pipelining also uses a single connection. Opportunistic FINs are not unique to SPDY." - I don't know why you bring up pipelining again when I've pointed out that multiplexing is superior. Why put up with response head of line blocking? And I don't know what you're exactly referring to with opportunistic FINs, perhaps you can explain in further detail?
And I'll throw in extra data points. Despite the fact that you don't feel like it's useful for mobile APIs, other non-Google parties clearly do:
Square (https://github.com/square/okhttp has their Android SPDY implementation)
Twitter (https://github.com/jpinner has their SPDY developer's work on Netty, which they use in their mobile APIs)
[1] I can only imagine this is why the pagination still appears completely broken (unknown or expired link).
You have to really change how your website gets served (at the cost to non-SPDY users) to get an increase in performance. Which usually ends up not even being 25%.
From what I've been able to gather, especially with little to no reports of any real-world benefits (I've only seen criticism of "bad" tests from SDPY supporters, but at the same time no one has posted a "good" test), I have to say SDPY is turning out to be hot air.
I'm hoping I'm wrong.
That, and the sites that care to implement it probably were speedy already.
When you talk about Google, or Facebook, or Twitter using it to squeeze out a few extra percentage points out of their latency or bandwidth or load-time - in their very highly specialized and optimized and conditional and resourceful environment, that's about as non real world as it get for the rest of us.
The fact that SPDY adaptation has mostly failed for the rest of the internet, says more about it than any white-paper or lab-result can.
Again, I hope I'm wrong here.
news.ycombinator.com Does Not Support SPDY
SPDY Protocol Not Enabled!
Seriously?
This SSL/TLS server is using the NPN Entension to tell browsers it supports alternative protocols, but SPDY is not a protocol it supports.
The server is not making SPDY an option. Since all the pieces are in place, hopefully it will be easy to enable SPDY support with this server.
(The typo is from the site) curl -I https://news.ycombinator.com
HTTP/1.1 501 Not Implemented
Server: nginx
Date: Mon, 06 May 2013 04:31:05 GMT
Content-Type: text/html
Content-Length: 174
Connection: close
don't see that one every day :) $ curl -IX GET https://news.ycombinator.com
HTTP/1.1 200 OK
Server: nginx
Date: Mon, 06 May 2013 04:41:40 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Cache-Control: private
X-Frame-Options: DENY
Cache-Control: max-age=0
Strict-Transport-Security: max-age=31556900; includeSubDomainsTurned off SPDY in browser for the moment, let's see if I get any more nginx errors.
http://blog.bubbleideas.com/2012/08/How-to-set-up-SPDY-on-ng...
http://stackoverflow.com/questions/15152775/how-to-set-up-sp...
We read quite many posts suggesting that SPDY doesn't help much but that's simply not true. At least in our case. If you're delivering assets over secured sockets layer, then SPDY is definitely a plus.
https://code.google.com/p/chromium/issues/detail?id=161751
Don't know, if it is a nginx thing, but all browsers had problems.