Published: Wed May 12 2021
CSR - Client-Side Render SSR - Server-Side Render SSG - Static Site Generation
CSR became popular due to JavaScript frameworks like Angular, Vue, and React. It offloads the hard work to the clients machine.
CSR applications use JavaScript to control what is displayed on the page, this typically means that instead of just downloading and displaying HTML the server sends a JavaScript file along to create and change the HTML.
How does this usually work?
Using CSR prolongs the initial load process. Once loaded the website will become faster. Once the initial load completes, navigation can be done dynamically and additional data can be loaded as needed. A great example of this is a SPA (Single Page Application)
SSR is the other common way to deal with JavaScript. It is in essence the opposite of CSR. With SSR the server does the rendering.
How does this work?
One massive difference is at this point every request needs to go back to the server to load. The browser is constantly requesting information from the server.
The downside of SSR is that the high resource utilization on the server-side and possible delays in delivering data to users. Load times are longer than SPAs. This is due to the server constantly rendering content.
SSG deals with static content. It can create faux-dynamic sites by generating variations, but the result is a site that is just HTML and CSS.
SSG uses a tool to generate static HTML websites based on raw data and templates. They can also automate the process of coding similar pages manually.
How does this work?