Content tagged “HTTP”

  1. The future of loading CSS - JakeArchibald.com

    Chrome’s about to change how it handles <link rel="stylesheet">. This is big news and Jake’s got the rundown:

    The plan is for each <link rel="stylesheet"> to block rendering of subsequent content while the stylesheet loads, but allow the rendering of content before it. The stylesheets load in parallel, but they apply in series. This makes <link rel="stylesheet"> behave similar to <script src="…"></script>.

    It’ll take some getting used to sprinkling <link rel="stylesheet"> throughout a page’s <body>, but the performance benefits (coupled with HTTP/2) will be worth it.

  2. Chunked transfer encoding in Rails (streaming)

    Using the Transfer-Encoding: chunked header, the server will send chunks of the rendered page back to the browser so in the case of Rails, it starts with the layout and sends out the <head> part including assets like js and css.

    Chunked transfer encoding is a great way to improve page performance for the parts of your application that require time-consuming database queries. The Rails-level changes are straightforward, but unfortunately not all Ruby web servers support the feature (looking at you, Puma).