One of the two commonly used terms in tech and are usually used together but offer different outputs and serve different purposes.we will explain the difference including when it is best to use one over the other so stay tuned.
static rendering is just used probably by less than 2% of the websites on the internet but is the most easier one to implement.think of it as just requesting an order for a meal at your local restaurant, instead of being given your meal once ready, you are given an empty tray without any meal on it (the meal is not yet ready but you have already been given a tray where you will put your meal) somehow that is very slow as the seller will take time to give you a tray,then head back to prepare your order.once your order is ready then the seller comes back and fills your tray with food, that is very incovenience (multipe requests and responses).
server side rendering on the other hand does the opposite it registers your order then gives it along with the tray once fully prepared (ready to be served) now this is very much time saving the seller only travels once and that is when your order is ready.
when the static site renders, it renders with empty content at first, then populate and load the entire page once every content of the page is available what are the drawbacks ? like every website/web app nowadays it fetches some data from the server, since it renders with empty page at first and only loads once the entire content is available, the http requests will not be possible to make so it will first wait for content to be available then wait for response for the request. testing it in a localhost machine will not show this as a flaw and bad user experience but when running on production with more than 100 users accessing it, it will expose that and users will not tolerate the 2 min loading speed while starring at blank screen.the solution to this is server side rendering.
how does server side rendering work ? the analogy of the seller and trays we used, remember it ? here also everything works like that the entire page loading is perfomed on the backend including http requests, so the browser only sends one response that is a response for a page request and data fetching is handled on server side it is time saving and convenient.
the prons of static rendering:
excels in providing fast web interactivity
requires minimal effort to configure
the cons of static rendering:
web crawlers cannot find tag information essential for SEO since it first renders empty so the is nothing to crawl or extract information from except the blank page itself of course.
the prons of server side rendering:
excels and provides very good user experience and security.
provides fast loading speed through one request approach.
follows SEO standard approach.
the cons of server side rendering:
may not provide fast web interactivity.
appreciate the time for reading ❤️❤️❤️
Top comments (0)