Tuesday, May 31, 2011

Failure to Launch: SPDY Server Push

I am about to give up on SPDY server push with node-spdy. Before I do, I feel compelled to give it one more try.

I took a step back last night (I think) when I concentrated on fiddling with relative URLs in the SYN_STREAM that initiated the push stream. It seemed a reasonable thing to try given that all URLs that show up in other streams are root relative (e.g. /style.css instead of https://localhost:8081/style.css).

The magical thing that goes missing when using relative URLs is the SPDY_STREAM_ADOPTED_PUSH_STREAM that I saw two nights ago:

t=1306724141170 [st=88] SPDY_STREAM_ADOPTED_PUSH_STREAM

To my still-in-training eye, that SPDY_STREAM_ADOPTED_PUSH_STREAM seems a good thing.

First up tonight, I fiddle with the point at which I send the data FIN on the push stream. The other night, I sent the push stream FIN immediately after sending the push stream DATA and before sending the FIN on the SYN_REPLY. Tonight, I try sending the push stream FIN after sending all of the data in the original reply (i.e. the homepage):

Reloading the page kinda-sorta works in that I see the homepage. Unfortunately, checking out the SPDY log in Chrome's about:net-internals shows that the RST_STREAM prevented the pushed stream from being "adopted". More importantly, the client ignores the pushed stylesheet and asks for it again:

There are no stray frames floating about that might give some indication of what to try next.

So, for now, I will shut down my direct effort to get SPDY server push working. I will keep working it in the background (along with ruby zlib), but will pick back up tomorrow by taking a closer look at compression in SPDY.