4 ms·
Does anyone have any specific examples of this?
by carsonreinke 12y ago
Does anyone have any specific examples of this?
- jacquesm 12y agoIf you put your email address in your profile (or send me a line) I'll reply with a link to a cam that is still online from way back when using this technology. I'd rather not post the link in the thread because the poor people sending out the stream would not be able to satisfy even a small portion of the kind of volume that HN can direct to a site in an eyeblink.
- maxk42 12y agoAlright, here's one of those dumb questions you seem very open to: Can we use this technique to (for example) reply with all of a page's dependencies upon the initial request? i.e. if a user goes to www.example.com/ and the server immediately replies with /, /favicon.ico, /styles.css, /script.js, /banner.png, etc? I imagine if it were possible, this would result in a massive reduction in latency...
- jacquesm 12y agoWell, you can and you can't. See the problem is that you have no idea what the next request will be about! So if you're sending the same kind of request from the client you can respond with a payload in the mime type that is being expected. But for your usecase you could receive a request for /style.css and respond with /favicon.ico if a client decided to make the requests in an order that you did not anticipate. If you get lucky it will work, but if you're unlucky then you'll be sending out the wrong payloads on all but the first request. The only reason this trick worked for the webcam is because it knows ahead of time what kind of request will come (the request for the next frame). That's why it can anticipate.
- maxk42 12y agoInformative!
- maxk42 12y agoNow that I think about it, one could use a small javascript library embedded in the index page to make a number of additional requests and interpret them as the correct types via data: URLs. That would be a lot of messy hacking to shave off a few hundred ms, but might be an interesting exercise to undertake...
- carsonreinke 12y agoUnless you use subdomains to know what asset is being requested (style.css.example.com). Even a wildcard subdomain would work.