DEV Community

Cover image for How to improve page load speed and response times: A comprehensive guide

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

Cess on February 26, 2024

This post was originally published on Hackmamba. Users' patience has grown thinner, and they tend to leave websites that take too long to load. Wh...
Collapse
 
fpaghar profile image
Fatemeh Paghar

πŸš€ Optimizing website performance is more crucial than ever! πŸ’» Users demand speedy experiences, and slow-loading sites can lead to frustration and drop-offs. πŸ• This insightful article on Hackmamba breaks down the importance of Page Load Times (PLT) and Server Response Times (SRT). πŸ’‘

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.