Content deleted Content added
No edit summary |
clean up section and more accurately describe server-side rendering |
||
Line 25:
Server-side scripts are completely processed by the servers instead of clients. When clients request a page containing server-side scripts, the application server processes the scripts and returns an HTML page to the client.
== Server-side rendering ==
With the advent of [[Single-page application|single-page applications]], an updated approach to server-side scripting was introduced, known as server-side rendering. With server-side rendering, static HTML can be sent from the server to the client, and client-side JavaScript then makes the web page [[Dynamic web page|dynamic]] by attaching event handlers to the HTML elements in a process called [[Hydration (web development)|hydration]]. Examples of frameworks that support server-side rendering are [[Next.js]], [[Nuxt.js]], [[Angular (web framework)|Angular]], and [[React (JavaScript library)|React]].
An alternative to server-side rendering is [[Static site generator|static site generation]]. With server-side rendering, the page is generally assembled on the server once per each request. By contrast, with static site generation, the application generates all the static HTML pages at build time. These pre-built pages are then sent to the client at each request, without having to build them again. This leads to faster rendering times, since a new page doesn't have to be generated on every request; the server simply hands over a file it already generated in the past. The downside is that when some data on the page changes, it needs to be rebuilt. Examples of static site generation tools are [[Jekyll (software)|Jekyll]] and [[Gatsby (software)|Gatsby]]. Sites generated by static site generation tools are often hosted on [[Netlify]] or [[GitHub]] pages.▼
▲An alternative to server-side rendering is [[Static site generator|static site generation]]. With server-side rendering, the page is generally assembled on the server once per each request. By contrast, with static site generation, the application generates all the static HTML pages at build time. These pre-built pages are then sent to the client at each request, without having to build them again. This leads to faster rendering times, since a new page doesn't have to be generated on every request; the server simply hands over a file it already generated in the past. The downside is that when some data on the page changes, it needs to be rebuilt.
== Languages ==
|