Skip to main content

Server-side rendering (SSR)

Say you can view your profile details at https://example.com/profile. The same URL is used for everyone, but the content is different. How do they make sure you see your own details?

One way is server-side rendering. It might go like this:

  1. You send the server an HTTP request with your login info in a cookie
  2. The server looks up this cookie in a database to find your details (name, profile pic...)
  3. It also fetches the 'profile' HTML template
  4. It slots your details into the proper place to render a complete HTML document
  5. It sends you that HTML document.

PHP is commonly used for SSR.

Contrast static site generation.