tag:blogger.com,1999:blog-581197352358126527.post3363156875598310377..comments2024-03-28T00:32:25.959-07:00Comments on japh(r) by Chris Strom: Stupid SPDY TricksAnonymoushttp://www.blogger.com/profile/00135361916531185929noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-581197352358126527.post-25097386639091140082012-03-07T04:56:26.848-08:002012-03-07T04:56:26.848-08:00Nope. No race condition here :)
The first thing t...Nope. No race condition here :)<br /><br />The first thing the long running SPDY push does is write the headers of the thing being pushed (the call to the _flushHead() private method). This goes out after the SYN_REPLY for the page, but before the DATA for the page. Thus, the browser already knows that "profile.js" is being sent to its cache before it has seen one byte of the web page that references it. By the time the browser parses the web page, noticing that it needs "profile.js", it has already determined that "profile.js" is on its way and won't re-request.<br /><br />If the push waited until after the DATA had been sent, then I'd have race condition on my hands. But, per the spec, "the SYN_STREAM for the pushed resources must be sent prior to sending any content which could allow the client to discover the pushed resource and request it." So it's all good :)Anonymoushttps://www.blogger.com/profile/00135361916531185929noreply@blogger.comtag:blogger.com,1999:blog-581197352358126527.post-59936326630737574742012-03-06T21:01:51.948-08:002012-03-06T21:01:51.948-08:00Is there a race condition in this example where th...Is there a race condition in this example where the client receives and parses the html containing script src="profile.js" and requests it from the server while the server is already busy trying to generate it? Does this introduce any problems or inefficiencies, like returning a script for profile.js twice if the client happens to parse and request profile.js before it receives the server-pushed version?Anonymoushttps://www.blogger.com/profile/01778627206210704732noreply@blogger.com