What Is Server Side Rendering? Is It Still Useful?

The past few years have seen a hoard of new JavaScript frameworks taking over web development. Skills with Single Page Applications and Progressive Web Apps are the new things that every new developer wants on their resume. Most of the web services are migrating towards Client Side Rendering with JavaScript frameworks. However, Server-side rendering has not lost its charm. ​

What is Server Side Rendering?

In modern JavaScript frameworks like angular, react and vue, JavaScript code is sent to the client from the server where it is rendered into normal HTML. This is known as client-side rendering. Server-side rendering refers to the process of rendering a web-page into plain HTML before sending it to the client. Pretty simple so far right. This was the case earlier and still exists today with many sites where languages like PHP would fetch the data from databases and compile it into an HTML document and send it to the user.

Is Server-Side Rendering Still useful

Now you must be wondering what is the point of server-side rendering. Since most of the front end code heavily relies on JavaScript that can be rendered on the client-side. The very simple reason is SEO or Search Engine Optimization. Client rendered websites do not go very well with SEO. ​

Google and other search engines crawl the contents of various websites to make them available in their search results. This is the only reason that server rendered sites still exist in the market. Though Google and other search engines have begun crawling client rendered websites, the efficiency is nowhere close to server rendered sites.

Also, Server Side Rendering feels a lot faster for the user since minimal resources are needed to load the webpage. People on slower connections might find it very tough to load the websites that are client rendered as an entire copy of the website needs to be transferred to the user. This might lead to the user downloading more than a few megabytes causing delay. On the other hand, Server rendered sites send simple HTML pages to the client that are more often than not, loaded instantly.

Server Rendering in JS frameworks

Though JavaScript frameworks are more famous for client rendered apps, they also have options for server rendering. Packages and libraries like preact, prerender, pre-render spa, etc allow developers to build sites that can be served both as pre-rendered and client rendered. This allows for the power of client rendering with benefits of server rendering.

Conclusion

Modern front end frameworks are making client rendering popular. However, server rendering has its own benefits that cannot be ignored. These benefits outweigh the cost of adding server-side rendering to a client rendered app. With benefits in SEO and faster loading times, Server rendering is not going away anytime soon. I hope you guys have a clear idea about the topic. If you are still confused about something. Drop a comment and I’ll be there for you.  ​