#ASKTHEINDUSTRY 08: Should you really compress all your initially rendered content into 14KB of data?

Yes. If you care — and you should! — about having your content rendered on your user’s mobile device in under a 1000ms you basically have not many other options.

First of all, in that 1000ms of time your user’s browser needs to:

  • Perform a DNS lookup
  • Perform a full network roundtrip to perform the TCP handshake
  • Send the HTTP request (which takes another full roundtrip)

On average, on a 3G connection, this leaves you just 400ms to:

  • Compute the response on the server
  • Layout and render the content on the browser

In such a scenario, it is vital that you minimize the additional roundtrips needed to perform the first render, in order to hit the 1000ms mark. Optimally you’d want no additional roundtrip, which brings us to the 14KB.

It is vital that you minimize the additional roundtrips needed to perform the first render

Indeed, due to how TCP works, the server can initially send only 10 packets (circa 14KB) before it needs to wait for the client to ACKnowledge the data (so that the congestion window can be widen). Long story short, all the information that the browser needs to render at least the visible (Above The Fold) content, typically markup and styles, should be compressed in those first 14KB of HTML data. Then, while your user starts to mentally process what you have displayed so far, you can deliver the rest of the page.

This piece is part of the #ASKTHEINDUSTRY project, a series of daily conversations with the Web Dev industry. You ask, I’ll answer, or find someone who can.




Learning material for eCommerce owners eager to explore the science behind building a successful online product.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alessandro Menduni

Alessandro Menduni

JavaScript Engineer, passionate about testing JavaScript and software architecture

More from Medium

So you’re looking for a package Manager?

⚡️10x speed up your Jest spin-up time by watchman

A kebab, a camel, and Pascal walked into a codespace…

Understanding Typescript Distributive Conditional Types with a Source Code Debugging Approach