What is SSR or Server-side rendering?
Akhlak Hossain Jim
Posted on January 10, 2022
In the arena of SPAs (Single Page Application) or React/Vue/Angular it's essential to know what server-side rendering is.
So, What is server-side rendering?
Server-side rendering is what you can say rendering in server.
As all JS libraries give us some functions that actually render all HTML, all styles, and all interactivity. So, that is what gives you the fast loading. But here comes the tricky part all browsers may not support JavaScript or in some cases, you shouldn't rely on JavaScript.
So in server-side rendering, all JavaScript functions run in the Server, and when your browser requests for data, it provides the compiled HTML, CSS, etc. Your website just renders like a pure HTML, CSS-written website.
Okay, But why should I care?
In this bright time of technology we just don't write HTML. It's the digital face of your brand. So you must ensure that everyone can see what you intended everyone to see. You cannot predict the end-user issues or what and what not that browser doesn't supports but for sure that browser supports plain HTML, CSS, so you should provide that as much as you can, to prevent unexpected behavior or an error.
That's where server-side rendering comes in handy. As it provides the server-side rendering, it actually helps the browser or any browser that asks for data to show it doesn't matter if that browser supports JavaScript or not.
How can we do that?
There are lots of frameworks out there, are just ready for use like Next.js, Gatsby.js. I personally like to use Next.js but every other framework is fine as well. It also provides code splitting and a whole other bunch of handy functionality. But with all of this, It's just making sure your powerful JS framework gives the most out of it, by ensuring server-side rendering.
Are there any other rendering methods out there?
Yes, as from previous you can guess that the framework provided JS functions can be run by and in your browser (which all updated browsers can just run fine) but ensuring the best user experience is what we frontend developers do.
So lastly, there is a lot of libraries and frameworks for you to make a difference, choose what works for you best and keep accessibility in mind and do good deeds.
Posted on January 10, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.