var spdy = require('spdy');
var fs = require('fs');
var options = {
key: fs.readFileSync(__dirname + '/keys/spdy-key.pem'),
cert: fs.readFileSync(__dirname + '/keys/spdy-cert.pem'),
ca: fs.readFileSync(__dirname + '/keys/spdy-ca.pem'),
};
var html = fs.readFileSync('index.html');
var imgs = [];
for (var i = 0; i < 10; i++) {
imgs[i] = fs.readFileSync(i + '.jpg');
}
function logic(req, res) {
if (req.url === '/') {
res.writeHead(200, {'Content-Type': 'text/html'});
res.end(html);
} else if (req.url.match(/\/[0-9]/)) {
var n = req.url[1];
res.writeHead(200, {'Content-Type': 'image/jpeg'});
res.end(imgs[n]);
}
}
spdy.createServer(options, logic).listen(8443);
Where index.html is just a list of 10 <img /> tag, and each image is ~800K.
Am I wrong if I expect to see in the SPDY event log in chrome://net-internals that the SPDY_SESSION_RECV_DATA events of the various streams (10 in this case) interleave?
What I see is instead that, firstly each stream is created:
Let's say I have a dummy script like this:
Where
index.html
is just a list of 10<img />
tag, and each image is ~800K
.Am I wrong if I expect to see in the SPDY event log in
chrome://net-internals
that theSPDY_SESSION_RECV_DATA
events of the various streams (10 in this case) interleave?What I see is instead that, firstly each stream is created:
and then
SPDY_SESSION_RECV_DATA
events arrive serially:That sounds strange to me since one goal of SPDY is to exactly avoid the HOL blocking of HTTP pipelining.
And this doesn't happen with Apache
mod_spdy
.How can you explain this behavior?