Able to explain the difference between server-side and client-side rendering Flashcards

1
Q

Server-side rendering (SSR)

A

Server-side rendering (SSR) involves

  • generating the complete HTML, CSS, and JavaScript code for a web page on the server
  • and sending it as a complete page to the user’s browser.
  • The browser then renders the page and executes any JavaScript code required for interactivity.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Server-Side Rendering (SSR) pros and cons

A

Pros

  • High level of SEO (Search Engine Optimization) search – the content of the pages get indexed more quickly than client-side type;
  • Better initial load time – Since the server sends a complete HTML page to the browser, the page can be displayed faster than with CSR, which requires additional time for JavaScript code to execute and fetch content.
  • Excellent static site.

Cons

  • Less interactivity: Since the page is fully formed before being sent to the browser, there is limited interactivity without additional requests to the server.
  • More server load: The server has to do more work to render the pages, which can result in slower response times and increased server load, especially with high traffic websites.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Client-side rendering (CSR)

A

Client-side rendering (CSR), on the other hand, means that

  • the web server sends only a basic HTML template to the browser, along with the necessary JavaScript and CSS files.
  • The browser then downloads the additional content
    • and uses JavaScript to dynamically render the content
    • and update the DOM (Document Object Model, With the HTML DOM, JavaScript can access and change all the elements of an HTML document.

) as needed.
- This approach allows for more interactive and dynamic web pages, but can also result in slower initial load times and decreased SEO (Search Engine Optimization) due to search engine bots not being able to easily parse JavaScript-generated content.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Client-side rendering (CSR) pros and cons

A

Pros

■ Rich site interactions
■ Fast website loading after initial load
■ Great for web applications

Cons

■ Low SEO
■ Initial load might take more time
■ In most cases, requires external library

How well did you know this?
1
Not at all
2
3
4
5
Perfectly