Content deleted Content added
Citation bot (talk | contribs) Removed parameters. | Use this bot. Report bugs. | #UCB_CommandLine |
|||
(17 intermediate revisions by 16 users not shown) | |||
Line 6:
}}
'''Server-side scripting''' is a technique used in [[web development]] which involves employing
Server-side scripting is often used to provide a customized [[User interface chrome|interface for the user]]. These scripts may assemble client characteristics for use in customizing the response based on those characteristics, the user's requirements, access rights, etc. Server-side scripting also enables the website owner to hide the [[source code]] that generates the interface, whereas, with client-side scripting, the user has access to all the code received by the client. A downside to the use of server-side scripting is that the client needs to make further requests over the network to the server in order to show new information to the user via the [[web browser]].<ref>{{cite web |url=https://www.cloudflare.com/en-gb/learning/serverless/glossary/client-side-vs-server-side/ |title=What do client side and server side mean? Client side vs. server side |publisher=Cloudflare |access-date=17 April 2025 }}</ref> These requests can slow down the experience for the user, place more load on the server, and prevent the use of the application when the user is disconnected from the server.
When the server serves data in a commonly used manner, for
Programs that run on a user's local computer without ever sending or receiving data over a network are not considered clients, and so the operations of such programs would not be considered client-side operations.
Line 17:
[[Netscape]] introduced an implementation of [[JavaScript]] for server-side scripting with [[Netscape Enterprise Server]], first released in December, 1994 (soon after releasing JavaScript for browsers).<ref name = "Newscape JavaScript Guide-1998">{{cite web|title=Server-Side JavaScript Guide|publisher=Netscape Communications Corporation|year=1998|url=http://docs.oracle.com/cd/E19957-01/816-6411-10/getstart.htm|access-date=2012-04-25}}</ref><ref name = "Morgan-Netcape LiveWie">{{cite web|title=Using Netscape™ LiveWire™, Special Edition | author=Mike Morgan | url = http://vampire.rulez.org/onlinedoc/book/NetscapeLiveWire/ch6.htm | year = 1996 | publisher = Que }}</ref>
Server-side scripting was later used in early
== Explanation ==
In the earlier days of the web, server-side scripting was almost exclusively performed by using a combination of [[C (programming language)|C]] programs, [[Perl]] scripts, and [[shell script]]s using the [[Common Gateway Interface]] (CGI). Those scripts were executed by the [[operating system]], and the results were served back by the [[web server]]. Many modern web servers can directly execute on-line [[scripting language]]s such as [[Active Server Pages|ASP]], [[JavaServer Pages|JSP]], [[Perl]], [[PHP]] and [[Ruby (programming language)|Ruby]] either by the web server itself or via extension modules (e.g. [[mod_perl]] or [[mod_php]]) to the webserver. For example,
Dynamic websites sometimes use custom web application servers, such as [[GlassFish|Glassfish]], [[Plack (software)|Plack]] and [[Python (programming language)|Python]]'s "Base HTTP Server" library, although some may not consider this to be server-side scripting. When using dynamic web-based scripting techniques, developers must have a keen understanding of the logical, temporal, and physical separation between the client and the server. For a user's action to trigger the execution of server-side code, for example, a developer working with classic ASP must explicitly cause the user's browser to make a request back to the webserver.
Line 27:
== Server-side rendering ==
With the advent of [[single-page application]]s, 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
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. 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]], [[Vercel]] or [[GitHub]] pages.
== See also ==
* [[Client-side scripting]]
Line 75 ⟶ 48:
== External links ==
{{Wikiversity | Server-Side Scripting}}
{{Web interfaces}}
|