Misplaced Pages

Server-side scripting: Difference between revisions

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Browse history interactively← Previous editContent deleted Content addedVisualWikitext
Revision as of 06:55, 5 August 2012 editFrosty (talk | contribs)Extended confirmed users, Pending changes reviewers, Rollbackers43,249 editsm Reverted 1 edit by 122.161.34.159 (talk) identified as vandalism to last revision by Seanbond5. (TW)← Previous edit Latest revision as of 00:23, 8 December 2024 edit undoFrap (talk | contribs)Autopatrolled, Extended confirmed users, File movers, Pending changes reviewers, Rollbackers33,239 edits Server-side rendering: add Vercek 
(231 intermediate revisions by more than 100 users not shown)
Line 1: Line 1:
{{Short description|Technique used in web development}}
{{Expert-subject|Technology|reason=unfocused, scattered, unnecessary details|date=April 2012}}
{{broader|Dynamic web page}}
{{Refimprove|date=October 2008}}
{{Multiple issues|
]
{{Expert needed|technology|reason=unfocused, scattered, unnecessary details|date=April 2012}}
'''Server-side scripting''' is a technique used in ] which involves embedding ]s in an ] ] which results in a user's (client's) request to the server website being handled by a script running server-side before the server responds to the client's request. The scripts can be written in any of a number of server-side scripting languages available (see below). Server-side scripting differs from ] where embedded scripts, such as ], are run client-side in the ].
{{More citations needed|date=October 2008}}
}}


Server-side scripting is usually used to provide an interface and to limit client access to proprietary databases or other data sources. 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 reduce user access to the source code of server-side scripts which may be proprietary and valuable in itself. The down-side to the use of server-side scripting is that the server website computer needs to provide most of the computing resources before sending a page to the client computer for display via its web browser. '''Server-side scripting''' is a technique used in ] which involves employing ]s on a ] which produces a response customized for each user's (client's) request to the website. Scripts can be written in any of a number of server-side scripting languages that are available. Server-side scripting is distinguished from ] where embedded scripts, such as ], are run client-side in a ], but both techniques are often used together. The alternative to either or both types of scripting is for the web server itself to deliver a ].


Server-side scripting is often used to provide a customized ]. 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 ] 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 ]. 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 example according to the ] or ] ], users may have their choice of a number of client programs (most modern web browsers can request and receive data using both of those protocols). In the case of more specialized applications, programmers may write their own server, client, and communications protocol, that can only be used with one another.

When the server serves data in a commonly used manner, for example, according to the ] or ] ], users may have their choice of a number of client programs (most modern web browsers can request and receive data using both of those protocols). In the case of more specialized applications, programmers may write their own server, client, and communications protocol, that can only be used with one another.


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. 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.


== History == == History ==
] introduced an implementation of ] for server-side scripting with ], 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 first used in early 1995 by ] while developing the first web site for Boston, MA television station . The technology is described in . The patent was issued in 1998 and is now owned by (OIN). In 2010 OIN named Fred DuFresne a for his work on server-side scripting.

Server-side scripting was later used in early 1996 by ] while developing the first website for Boston, MA television station ]. The technology is described in . The patent was issued in 1998 and is now owned by ] (OIN). In 2010, OIN named Fred DuFresne a for his work on server-side scripting.


== Explanation == == Explanation ==
In the earlier days of the web, server-side scripting was almost exclusively performed by using a combination of ] programs, ] scripts, and ]s using the ] (CGI). Those scripts were executed by the ], and the results were served back by the web server. Many modern web servers can directly execute on-line scripting languages such as ] and ] either by the web server itself or via extension modules (e.g. ] or ]) to the web server. For example, ] includes its own embedded database system. Either form of scripting (i.e., CGI or direct execution) can be used to build up complex multi-page sites, but direct execution usually results in lower overhead due to the lack of calls to external interpreters. In the earlier days of the web, server-side scripting was almost exclusively performed by using a combination of ] programs, ] scripts, and ]s using the ] (CGI). Those scripts were executed by the ], and the results were served back by the ]. Many modern web servers can directly execute on-line ]s such as ], ], ], ] and ] either by the web server itself or via extension modules (e.g. ] or ]) to the webserver. For example, ] includes its own embedded database system. Either form of scripting (i.e., CGI or direct execution) can be used to build up complex multi-page sites, but direct execution usually results in less overhead because of the lower number of calls to external interpreters.


Dynamic websites sometimes use custom web application servers, for example the ] "Base HTTP Server" library, although some may not consider this to be server-side scripting. When designing using dynamic web-based scripting technics, like classic ASP or PHP, 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 web server. Creating such interactions can easily consume much development time and lead to unreadable code. Dynamic websites sometimes use custom web application servers, such as ], ] and ]'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.


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 scripting languages== <!-- please don't list languages like Python, Perl, and Ruby here, see ] -->

== Server-side rendering ==
With the advent of ]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 ] by attaching event handlers to the HTML elements in a process called ]. Examples of frameworks that support server-side rendering are ], ], ], and ].

An alternative to server-side rendering is ]. 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 ] and ]. Sites generated by static site generation tools are often hosted on ], ] or ] pages.

== Languages ==
<!-- Please don't list languages like Python, Perl, and Ruby here, see ] -->
There are a number of server-side scripting languages available, including: There are a number of server-side scripting languages available, including:
* ] (*.asp, *.aspx) * ] (*.avfp)
* ] (*.asp)
* ] via ] (*.c, *.csp)
* ] (*.aspx)
* ] (*.cshtml, *.vbhtml)
* ] (*.cfm) * ] (*.cfm)
* ] via ] (*.jsp) * ] (*.go)
* ] using ] (*.ssjs, *.js) * ] (*.gs)
* ] (*.lp *.op) * ] (*.php)
* ] (*.hs) (example: ])
* ] (*.cgi, *.ipl, *.pl)
* ] (*.jsp, *.do) via ]
* ] (*.php)
* ] using ] (*.ssjs, *.js) (example: ])
* ] via ] (*.py)
* ], e.g. ] (*.rb, *.rbw)
* ] (*.smx)
* ] (*.lasso) * ] (*.lasso)
* ] (*.lp *.op *.lua)
* ] (*.p)
* ] via the ] module (*.cgi, *.ipl, *.pl)
* ] (*.php, *.php3, *.php4, *.phtml)
* ] (*.py) (examples: ], ], ])
* ] (*.rhtml)
* ] (*.rb, *.rbw) (example: ])
* ] (*.tcl)
* ] (*.dna,*.tpl) * ] (*.dna,*.tpl)
* ] (*.r,*.w) * ] (*.r,*.w)


==See also== == See also ==
* ]
* ]
* ]
* ] * ]
* ] * ] (CMS)
* ] * ]
* ]
* ]
* ]
* ]
* ]
* ]
* ] (SSI)
* ]

== References ==
{{Reflist}}

== External links ==
{{Wikiversity | Server-Side Scripting}}
;


{{Web interfaces}}
==External links==
* {{dmoz|Computers/Programming/Internet/Server_Side_Scripting}}


{{DEFAULTSORT:Server-Side Scripting}} {{DEFAULTSORT:Server-Side Scripting}}
] ]

]
]
]
]
]
]
]
]
]
]

Latest revision as of 00:23, 8 December 2024

Technique used in web development For broader coverage of this topic, see Dynamic web page.
This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these messages)
This article needs attention from an expert in technology. The specific problem is: unfocused, scattered, unnecessary details. WikiProject Technology may be able to help recruit an expert. (April 2012)
This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "Server-side scripting" – news · newspapers · books · scholar · JSTOR (October 2008) (Learn how and when to remove this message)
(Learn how and when to remove this message)

Server-side scripting is a technique used in web development which involves employing scripts on a web server which produces a response customized for each user's (client's) request to the website. Scripts can be written in any of a number of server-side scripting languages that are available. Server-side scripting is distinguished from client-side scripting where embedded scripts, such as JavaScript, are run client-side in a web browser, but both techniques are often used together. The alternative to either or both types of scripting is for the web server itself to deliver a static web page.

Server-side scripting is often used to provide a customized 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. 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 example, according to the HTTP or FTP protocols, users may have their choice of a number of client programs (most modern web browsers can request and receive data using both of those protocols). In the case of more specialized applications, programmers may write their own server, client, and communications protocol, that can only be used with one another.

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.

History

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).

Server-side scripting was later used in early 1996 by Fred Dufresne while developing the first website for Boston, MA television station WCVB. The technology is described in US patent 5835712. The patent was issued in 1998 and is now owned by Open Invention Network (OIN). In 2010, OIN named Fred DuFresne a "Distinguished Inventor" for his work on server-side scripting.

Explanation

In the earlier days of the web, server-side scripting was almost exclusively performed by using a combination of C programs, Perl scripts, and shell scripts 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 languages such as ASP, JSP, Perl, PHP and Ruby either by the web server itself or via extension modules (e.g. mod_perl or mod_php) to the webserver. For example, WebDNA includes its own embedded database system. Either form of scripting (i.e., CGI or direct execution) can be used to build up complex multi-page sites, but direct execution usually results in less overhead because of the lower number of calls to external interpreters.

Dynamic websites sometimes use custom web application servers, such as Glassfish, Plack and 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.

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 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 by attaching event handlers to the HTML elements in a process called hydration. Examples of frameworks that support server-side rendering are Next.js, Nuxt.js, Angular, and React.

An alternative to server-side rendering is 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 and Gatsby. Sites generated by static site generation tools are often hosted on Netlify, Vercel or GitHub pages.

Languages

There are a number of server-side scripting languages available, including:

See also

References

  1. "Server-Side JavaScript Guide". Netscape Communications Corporation. 1998. Retrieved 2012-04-25.
  2. Mike Morgan (1996). "Using Netscape™ LiveWire™, Special Edition". Que.

External links

Web interfaces
Server-side
Protocols
Server APIs
Apache modules
Topics
Client-side
Browser APIs
Web APIs
WHATWG
W3C
Khronos
Others
Topics
Related topics
Category: