How is a dynamic page rendered? When the user requests a site, the server queries one or more databases for content, then passes result to templating engine which formats everything into an HTML file for user (dynamically rendered)
With each request from the end user, the HTML code the user gets back from the server is not always the same. The HTML markup you get back adjusts dynamically on the server
Dynamic: things change on the server and new requests can yield a different file
Static: the files never change, they sit on the server and you always get the same exact version
The server returns a dynamically generated HTML page. That page is not necessarily always the same because the HTML code and even the JS code can be generated on the server
The server is not involved in page rendering after serving the HTML/CSS/JS files. Although, page content can still be changed via JS in the browser)
The server side is not doing anything on the loaded page once it’s in the browser. Dynamic rendering is really about that first render when you send the request and get back a page
Dynamic does NOT mean that there’s no HTML page being served— it’s just built dynamically for each request
- Finished page is served but needs to be generated first
- Better for SEO because all the page’s content is available on first load
- Users don’t have to wait for the data after page loads, but they do have to wait for page to load
- Security tends to be easy to implement because it’s so common for dynamic sites
- Requires a hosting service which supports the chosen server-side language (and version). Dynamic hosts tend to be more complex to setup and expensive
AWS EC2/ Elastic Beanstalk, Heroku