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:
- You send the server an HTTP request with your login info in a cookie
- The server looks up this cookie in a database to find your details (name, profile pic...)
- It also fetches the 'profile' HTML template
- It slots your details into the proper place to render a complete HTML document
- It sends you that HTML document.
PHP is commonly used for SSR.
Contrast static site generation.