Skip to main content

Web

  • 3 types
    1. Client Side Rendering (CSR)
    2. Server Side Rendering (SSR)
    3. Pre-rendering / Static Site Generation (SSG)

Rendering

OrderClient Side RenderingServer Side RenderingPre-rendering / Static Site Generation
1User requests a websiteUser requests a websiteUser requests a website
2Server sends HTML file with JavaScript linksServer creates ready HTML filesServer sends static HTML file with JavaScript resources
3Browser downloads HTMLBrowser renders HTML, but it's not interactiveBrowser renders HTML and downloads JavaScript
4Browser downloads CSS and JavaScriptBrowser downloads JavaScriptUser see the static page, not interactive
5Browser executes framework or libraryBrowser executes JavaScriptUser is redirected to right file
6Browser loads the websiteWebsite is fully interactiveWebsite is fully interactive

Pros

Client Side RenderingServer Side RenderingPre-rendering / Static Site Generation
fast rendering after initial loadingSearch engines bots can crawl for a better SEObetter user experience for the first loading
good for web apps with lots of logic, and needs authorizationInitial loading is fasterbetter SEO
a lot of JavaScript frameworks and libraries supporting itless requests than with SSR

Cons

Client Side RenderingServer Side RenderingPre-rendering / Static Site Generation
low Search Engine Optimization (SEO)lots of server requestsneed to wait for interactivity until JavaScript is loaded
initial loading may take some timefull page reloadsneed to provide user-friendly design for the first loading if data is required
slow rendering when app has a lot of interactivity

Usage

Client Side RenderingServer Side RenderingPre-rendering / Static Site Generation
if app has a lot of dynamic dataif app UI is complex but with a small amount of interactivityif app has a UI with contents used for SEO
if app has very complex UIif app is a more static pageif part of app is available for users without authentication
if app is focused on a bigger number of usersif the amount of users is not largeif don't want to use SSR, but need to improve loading time and SEO
if app needs authorization to be accessedif app has more static content on the first page
if app doesn't have a lot of content used for SEO

Frameworks / Libraries

  • React can be used for all 3 types
Client Side RenderingServer Side RenderingPre-rendering / Static Site Generation
ReactJinja2 on DjangoNextJS (React)
AngularJinja2 on FlaskGatsby
VueEmbedded JavaScript templates on ExpressJSHugo
jQueryReact on ExpressJS
Ruby on Rails
ASP.NET CORE