<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jeremy Yip on Medium]]></title>
        <description><![CDATA[Stories by Jeremy Yip on Medium]]></description>
        <link>https://medium.com/@jeremy.yip7?source=rss-8d484190b1be------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*iDBWiWe14wE1dhZX1s-xnw.jpeg</url>
            <title>Stories by Jeremy Yip on Medium</title>
            <link>https://medium.com/@jeremy.yip7?source=rss-8d484190b1be------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 01:53:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jeremy.yip7/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Approaching Lightspeed with HTTP/2 (Part 2)]]></title>
            <link>https://medium.com/@jeremy.yip7/approaching-lightspeed-with-http-2-part-2-d431d3e97c2b?source=rss-8d484190b1be------2</link>
            <guid isPermaLink="false">https://medium.com/p/d431d3e97c2b</guid>
            <category><![CDATA[https]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[http2]]></category>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Jeremy Yip]]></dc:creator>
            <pubDate>Tue, 16 Aug 2016 19:34:28 GMT</pubDate>
            <atom:updated>2016-08-28T06:13:42.143Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xKdfVWZRFQ21JCKPi7qYGw.png" /></figure><p>Quick recap from the last blog:</p><ul><li>HTTP/1.1 is <em>slow </em>because at the advent of the internet, we didn’t expect this <strong><em>modern web thing </em></strong>to get huge.</li><li>HTTP/2 is <em>faster </em>because it’s the Burger King of network protocols. Have it your way<em> — </em>send as many requests and receive as many responses as you want at anytime through multiplexing.</li></ul><p>If you have questions, check out my <a href="https://medium.com/@jeremy.yip7/approaching-lightspeed-with-http-2-part-1-535d6291b05#.j5uygrolq">Part 1</a> on the topic. Without further delay, let’s talk about what HTTP/2 can do for us.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*AogZ_8qUQ_Kjm-kAVAf56A.gif" /><figcaption>Finally!</figcaption></figure><h3>Benefits of HTTP/2</h3><h4>1. Server Pushing</h4><p>With HTTP/2, the server can send <strong>multiple</strong> responses to <strong>one</strong> request. This may sound odd, but check out the diagram.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*q-KCpR1EmtWXDjyJ6FM39Q.png" /></figure><p>Think about <em>styles.css</em> and <em>scripts.js</em> and the left-most portion of the image. Because of the limitations of HTTP/1.1, we have to wait for a response <strong>every</strong> time we make a request.</p><p>HTTP/2 and server pushing lets us proactively send resources. Your <em>index.html </em>already has information about any dependencies in <strong>&lt;link&gt;</strong> and <strong>&lt;script&gt;</strong> tags. Why wait for the client to request each one explicitly? Send them all, and send them asynchronously!</p><h4>2. Prioritization</h4><p><em>Why on Earth would I ever want to receive responses asynchronously? We can’t display a webpage with CSS. What if the HTML document shows up last and delays page load?</em></p><p>Great point. Because of that consideration, we also have the ability to decide two things:</p><ol><li>The order in which files are sent through <strong>stream dependencies</strong>.</li><li>Which file streams receive more “<strong>weight</strong>” or dedicated resources like CPU / RAM when information is being sent concurrently.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*QHfDnkFljgCNf8OaoVhw6A.png" /><figcaption>With HTTP/2, we can assign integer “weights” to each file stream from 0–256 representing the proportional amount of resources to dedicate to each file.</figcaption></figure><p>The above image is a hypothetical scenario of HTTP/2 prioritization:</p><ol><li>We set the <em>index.html </em>stream as a dependency for our <em>style.css </em>stream. Thus, the <em>index.html </em>response will receive all CPU / RAM resources before the stylesheet.</li><li>We then set <em>style.css </em>as a dependency of the <em>jquery.js</em>, <em>scripts.js</em>, and <em>image.png</em> streams. Again, all resources will be dedicated to a response with the stylesheet before our scripts and images.</li><li>Once <em>style.css </em>is handled, we work with three file streams concurrently. To calculate allocation of resources, we add the previously assigned stream “weights” together (6 + 3 + 1 = 10) and determine proportional importance.</li></ol><ul><li>jquery.js stream will receive 6/10 or 60% of resources.</li><li>scripts.js will receive 3/10 or 30% of resources.</li><li>image.png will receive 1/10 or 10% of resources.</li></ul><h3>Check out these awesome, very related links</h3><p><a href="https://www.igvita.com/2013/06/12/innovating-with-http-2.0-server-push/">https://www.igvita.com/2013/06/12/innovating-with-http-2.0-server-push/</a><br><a href="https://nghttp2.org/blog/2014/04/27/how-dependency-based-prioritization-works/">https://nghttp2.org/blog/2014/04/27/how-dependency-based-prioritization-works/</a><br><a href="http://blog.scottlogic.com/2014/11/07/http-2-a-quick-look.html">http://blog.scottlogic.com/2014/11/07/http-2-a-quick-look.html</a><a href="https://hpbn.co/http2/">https://hpbn.co/http2/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d431d3e97c2b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Approaching Lightspeed with HTTP/2 (Part 1)]]></title>
            <link>https://medium.com/@jeremy.yip7/approaching-lightspeed-with-http-2-part-1-535d6291b05?source=rss-8d484190b1be------2</link>
            <guid isPermaLink="false">https://medium.com/p/535d6291b05</guid>
            <category><![CDATA[tcp]]></category>
            <category><![CDATA[https]]></category>
            <category><![CDATA[http2]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[optimization]]></category>
            <dc:creator><![CDATA[Jeremy Yip]]></dc:creator>
            <pubDate>Thu, 28 Jul 2016 19:02:43 GMT</pubDate>
            <atom:updated>2016-08-28T00:22:55.285Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T7--SeclJwoZhOizLwFqzw.jpeg" /><figcaption>Hold on Chewie!</figcaption></figure><p>In 1991, we were introduced to the majesty of HTTP 1.0. At the time it was fine. Well, it <em>was, </em>up until a visit to Ebay.com could result in a flippin deluge of 84 resources being sent to the client.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/273/1*1WVGEd2Ja6SyXq9_cVQvoA.jpeg" /><figcaption>Thank you sir, may I have another resource?</figcaption></figure><h4>Serialized What Now?</h4><p>Why are that many scripts and images a problem? We can blame HTTP 1.0 and its <strong>serialized request-response protocol</strong>. (Let’s break down that blurb.)</p><p>I’m a client. I send a request to the server. They haven’t gotten back to me. Tough luck. I can’t make more requests along a TCP-based connection until I receive a response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/325/1*rFE23rFsB1WbnkbkH3CCdw.png" /></figure><p>For example, if I ask a server for their <em>index.html</em>, I have to wait until I receive a reply before I ask for <em>styles.css. </em>Now imagine making a request for each resource. 80. Times. Excuse me while I fume quietly in a corner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*ZTpUSDs2PJxct_eK3fuSNQ.jpeg" /><figcaption>Yeah.</figcaption></figure><p>That is precisely why <strong>bundling</strong> javascript or inlining CSS files <strong>is a necessary evil</strong>. It limits the amount of requests and files sent along the serialized HTTP/1 protocol, but…</p><ul><li>What if we change a single line of the codebase?</li><li>We have to re-bundle, and the user has to redownload the entire monolith of code, ruining caching strategies.</li></ul><p>Hence, necessary evil.</p><p><em>Hold the phone. Don’t we already have pipelining with HTTP/1.1?</em></p><p>Well, yeah. Pipelining describes the idea of making multiple requests along a single connection. Voila! This is the answer to our original complication, right?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*e-v-c30L5nYRYfDVzMY6GQ.png" /><figcaption>Thanks Wikipedia.</figcaption></figure><p>Not quite… The bottleneck now switches from <strong>requests</strong> to <strong>responses</strong>. Notice how in the diagram, the pipelined responses still need to be sent <em>in order</em>. This phenomenon is called <em>Head-of-line blocking</em>, which means that if the first response isn’t ready to be sent off or is rather large, we’ve got a queue of responses being held up by that first response.</p><h3>SPDY and HTTP 2.0</h3><p>Google noticed this bottleneck too, and tried to circumvent the problem by testing <em>multiple</em> connections between client and server. More connections mean more concurrent requests, but it’s a double-edged sword, because it also leads to significantly more congestion for servers.</p><p>With extensive experimentation, they found the goldilocks number to be 6 open connections. Does that sound hack-y? That’s because it is — the deep underlying mechanisms of TCP are optimized for a single connection, not several.</p><p>Eventually, the tech behemoth began development on a networking protocol dubbed SPDY (pronounced Speedy) around 2009: what would become the heart of HTTP/2.</p><p>SPDY’s alternative to pipelining would be a technique called multiplexing. It allows us to create <strong>both </strong>asynchronous requests and asynchronous responses. Without too much nitty gritty detail, multiplexing facilitates better performance, cheaper deployment, and a variety of bonus features like Server pushing, Prioritization, and Flow Control that make HTTP/2 so attractive (which we’ll discuss in the <a href="https://medium.com/@jeremy.yip7/approaching-lightspeed-with-http-2-part-2-d431d3e97c2b#.7p022ycfv">next blog post</a>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*c2l72B9rfgQVjvZ7nRTHxg.jpeg" /></figure><p>Credit for the content idea goes to Ilya Grigorik of Google and his talk on the ChangeLog podcast. If you have any corrections or comments, feel free to get in touch with me.</p><h4>Useful Links</h4><p><a href="https://github.com/http2">HTTP/2</a></p><p><a href="http://qnimate.com/what-is-multiplexing-in-http2/">http://qnimate.com/what-is-multiplexing-in-http2/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=535d6291b05" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>