DEV Community

Cover image for Best Ways to Optimise Website Content Delivery

Best Ways to Optimise Website Content Delivery

Cloakd on March 08, 2023

Overview Optimising website content delivery is crucial to ensure your website loads quickly and provides a great user experience. This ...
Collapse
 
cloakd profile image
Cloakd

Let me know any other ways you know of that help speed up website load times!

Collapse
 
joelbonetr profile image
JoelBonetR 🥇 • Edited

I can think of some extra thingies:

  • Priotiry hints and fetchPriority are a great help as well.
  • Using a Functional Programming approach rather than an Object Oriented approach makes your App tree-shakeable, so bundlers can remove unused code paths from the production build.
  • Server-Side Rendering and Static Site Generation also plays an important role on modern web apps that require SEO.
  • Currently tools that makes that easy for you to handle (like Next JS) began to use streams (see Streaming SSR) to push data from the server to the client on a flux of data instead the classical HTTP 1.1 request-response "loop", taking advantage of the latest HTTP version (see HTTP/3) which improves significantly the overall performance/experience, and we'll see this trend in any framework that wants to be up-to-date with current features.

Best regards! 😁

Edit:
Just out of curiosity, aren't all CDNs decentralised? 😅 What am I missing?

Thank you

Collapse
 
cloakd profile image
Cloakd

Great points! SSR i tend to avoid due to the nature of frameworks changing every 3 months so always tend to stay as agnostic as possible!

CDNs are all distributed but not decentralised, in the traditional sense a single entity can censor & decide exactly what & how the network reacts. Whereas in a dCDN its up to each individual operator!

When it comes to serving more remote regions a mesh network of individual nodes really helps here when it comes to latency! Most normal CDNs are usually just hosted on the "Edge" (in the main terminating DataCenters) so works great in built up areas but not so much elsewhere :)

Thread Thread
 
joelbonetr profile image
JoelBonetR 🥇
Great points! SSR i tend to avoid due to the nature of frameworks changing every 3 months so always tend to stay as agnostic as possible!

frameworks do evolve but you won't be re-coding everything on a new framework/lib each 3 months nor each year 😅

You can use the API-first approach that Next JS implements as example; it allows you to code a monolithic App to reduce initial infrastructure costs and whenever you need to scale, you just pick the /api directory and deploy it as Node Express App somewhere else 😁 or if you prefer so, build external APIs from the beginning, nothing stops you on doing so

CDNs are all distributed but not decentralised, in the traditional sense a single entity can censor & decide exactly what & how the network reacts. Whereas in a dCDN its up to each individual operator! When it comes to serving more remote regions a mesh network of individual nodes really helps here when it comes to latency! Most normal CDNs are usually just hosted on the "Edge" (in the main terminating DataCenters) so works great in built up areas but not so much elsewhere :)

Thank you very much for the explanation, I mixed up concepts!
I get to know how CDNs work more or less and also how Netflix sent servers to ISPs so they plug them in the "switchboards" to act as CDN for videos.
Each thing you learn in IT has 10 miles worth of roots 😂

Where can I learn more about this dCDN stuff?