DEV Community

Discussion on: How to improve page load speed and response times: A comprehensive guide

Collapse
 
efpage profile image
Eckehard • Edited

Often underestimated is the round trip time (RTT), as this might easily multiply. Assume you store your page setup in a database. Before you can query the setup, you need to perform multiple requests:

  • User inputs an URL
  • Server responds with the initial HTML file
  • Browser find some external libaries, that need to be loaded
  • After all libs are ready, the page can be evaluated
  • Now you can query your database.
  • Response is sent
  • Now you can start to load your final setup

As you might see, this ping-pong game can add a new Round trip on each step it performs.

Image description

Browsers usually use a preload scanner to find external resources. So, they can start to load files before even the page is evaluated (See here or here for more details). Even if you donΒ΄t need a file, it might be useful to put a reference in the main HTML file to start preloading it. It might stay in the cache and be ready if you need it later.

It is very important to understand this relations to speed up your pages.