
Server-side scripting is a technique used in
web development
Web development is the work involved in developing a website for the Internet (World Wide Web) or an intranet (a private network). Web development can range from developing a simple single static page of plain text to complex web application ...
which involves employing
script
Script may refer to:
Writing systems
* Script, a distinctive writing system, based on a repertoire of specific elements or symbols, or that repertoire
* Script (styles of handwriting)
** Script typeface, a typeface with characteristics of ha ...
s on a web server which produces a response customized for each user's (client's) request to the website. The alternative is for the web server itself to deliver a
static web page
A static web page (sometimes called a flat page or a stationary page) is a web page that is delivered to the user's web browser exactly as stored, in contrast to dynamic web pages which are generated by a web application.
Consequently, a stati ...
. Scripts can be written in any of a number of server-side scripting languages that are available (see below). Server-side scripting is distinguished from
client-side scripting
A server-side dynamic web page is a web page whose construction is controlled by an application server processing server-side scripts. In server-side scripting, parameters determine how the assembly of every new web page proceeds, and includi ...
where embedded scripts, such as
JavaScript
JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of Website, websites use JavaScript on the Client (computing), client side ...
, are run client-side in a
web browser
A web browser is application software for accessing websites. When a user requests a web page from a particular website, the browser retrieves its files from a web server and then displays the page on the user's screen. Browsers are used on ...
, but both techniques are often used together.
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
The Hypertext Transfer Protocol (HTTP) is an application layer protocol in the Internet protocol suite model for distributed, collaborative, hypermedia information systems. HTTP is the foundation of data communication for the World Wide Web, ...
or
FTP
The File Transfer Protocol (FTP) is a standard communication protocol used for the transfer of computer files from a server to a client on a computer network. FTP is built on a client–server model architecture using separate control and data ...
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
JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of Website, websites use JavaScript on the Client (computing), client side ...
for server-side scripting with
Netscape Enterprise Server
Oracle iPlanet Web Server (OiWS) is a web server designed for medium and large business applications. Previous versions were marketed as Netscape Enterprise Server, iPlanet Web Server, Sun ONE Web Server, and Sun Java System Web Server.
Oracle ...
, first released in December, 1994 (soon after releasing JavaScript for browsers).
Server-side scripting was later used in early 1995 by
Fred DuFrense while developing the first website for Boston, MA television station
WCVB
WCVB-TV (channel 5) is a television station in Boston, Massachusetts, United States, affiliated with ABC and owned by Hearst Television. The station's studios are located on TV Place (off Gould Street near the I-95/ MA 128/Highland Avenue i ...
. The technology is described i
US patent 5835712 The patent was issued in 1998 and is now owned by
Open Invention Network
Open Invention Network (OIN) is a company that acquires patents and licenses them royalty-free to its community members who, in turn, agree not to assert their own patents against Linux and Linux-related systems and applications.
History
The co ...
(OIN). In 2010 OIN named Fred DuFresne
"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
Perl is a family of two High-level programming language, high-level, General-purpose programming language, general-purpose, Interpreter (computing), interpreted, dynamic programming languages. "Perl" refers to Perl 5, but from 2000 to 2019 it ...
scripts, and
shell script
A shell script is a computer program designed to be run by a Unix shell, a command-line interpreter. The various dialects of shell scripts are considered to be scripting languages. Typical operations performed by shell scripts include file manip ...
s using the
Common Gateway Interface
In computing, Common Gateway Interface (CGI) is an interface specification that enables web servers to execute an external program, typically to process user requests.
Such programs are often written in a scripting language and are commonly re ...
(CGI). Those scripts were executed by the
operating system
An operating system (OS) is system software that manages computer hardware, software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ef ...
, and the results were served back by the webserver. Many modern web servers can directly execute on-line scripting languages such as
ASP,
JSP,
Perl
Perl is a family of two High-level programming language, high-level, General-purpose programming language, general-purpose, Interpreter (computing), interpreted, dynamic programming languages. "Perl" refers to Perl 5, but from 2000 to 2019 it ...
,
PHP
PHP is a General-purpose programming language, general-purpose scripting language geared toward web development. It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1993 and released in 1995. The PHP reference implementati ...
and
Ruby
A ruby is a pinkish red to blood-red colored gemstone, a variety of the mineral corundum (aluminium oxide). Ruby is one of the most popular traditional jewelry gems and is very durable. Other varieties of gem-quality corundum are called sapp ...
either by the web server itself or via extension modules (e.g.
mod_perl
Mod, MOD or mods may refer to:
Places
* Modesto City–County Airport, Stanislaus County, California, US
Arts, entertainment, and media Music
* Mods (band), a Norwegian rock band
* M.O.D. (Method of Destruction), a band from New York City, U ...
or
mod_php) to the webserver. For example,
WebDNA
WebDNA is a server-side scripting, interpreted language with an embedded database system, specifically designed for the World Wide Web. Its primary use is in creating database-driven dynamic web page applications. Released in 1995, the name was r ...
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
GlassFish is an open-source Jakarta EE platform application server project started by Sun Microsystems, then sponsored by Oracle Corporation, and now living at the Eclipse Foundation and supported by Payara, Oracle and Red Hat. The supported ...
,
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
In the beginning of the web content was generated purely on the back end. After the big adoption of front end
single-page application
A single-page application (SPA) is a web application or website that interacts with the user by dynamically rewriting the current web page with new data from the web server, instead of the default method of a web browser loading entire new pages. ...
s, a new approach was introduced to generate the HTML using the client application, but on the back end. Examples of frameworks that use
SSR are
Next.js,
Nuxt.js
Nuxt.js is a free and open source JavaScript library based on Vue.js, Node.js, Webpack and Babel.js. Nuxt is inspired by Next.js, which is a framework of similar purpose, based on React.js.
The framework is advertised as a "Meta-framework fo ...
and
Nest.js. They use
React.js
React (also known as React.js or ReactJS) is a Free and open-source software, free and open-source Front end and back end, front-end JavaScript library for building user interfaces based on Component-based software engineering, components. It i ...
,
Vue.js
Vue.js (commonly referred to as Vue; pronounced "view") is an open-source model–view–viewmodel front end JavaScript framework for building user interfaces and single-page applications. It was created by Evan You, and is maintained by him a ...
, and
Angular, respectively, to generate the content of the server.
Server-side generation
Another similar to SSR technique of generating content for a website is using Server-side generation. This technique use application that create static html pages and then those files are send to the server. File generation can happen on completely different computer for example using
continuous delivery
Continuous delivery (CD) is a software engineering approach in which teams produce software in short cycles, ensuring that the software can be reliably released at any time and, following a pipeline through a "production-like environment", witho ...
. Example of SSG tools are
Jekyll Jekyll may refer to:
Entertainment Film
* ''The Two Faces of Dr. Jekyll'', a 1960 horror film
* ''Dr. Jekyll y el Hombre Lobo'', a 1972 Spanish horror film
* ''Jekyll'', a 2007 horror film
Television
* ''Jekyll'' (TV series), a 2007 BBC televisi ...
,
Gatsby or
Eleventy. Those sites are often hosted on
Netlify or
GitHub
GitHub, Inc. () is an Internet hosting service for software development and version control using Git. It provides the distributed version control of Git plus access control, bug tracking, software feature requests, task management, co ...
pages. GitHub also supports Jekyll projects where it automatically build the site when changes are added to
git
Git () is a distributed version control system: tracking changes in any set of files, usually used for coordinating work among programmers collaboratively developing source code during software development. Its goals include speed, data integ ...
.
Languages
There are a number of server-side scripting languages available, including:
*
ActiveVFP
ActiveVFP (also known as AVFP) is a server-side scripting framework designed for Web development to produce dynamic Web pages. Similar to PHP, but using the native Visual Foxpro (VFP) language and database (or other databases like Microsoft SQL ...
(*.avfp)
*
ASP (*.asp)
*
ASP.NET Web Forms (*.aspx)
*
ASP.NET Web Pages
Razor is an ASP.NET programming syntax used to create dynamic web pages with the C# or VB.NET programming languages. Razor was in development in June 2010 and was released for Microsoft Visual Studio 2010 in January 2011. Razor is a simple-synta ...
(*.cshtml, *.vbhtml)
*
ColdFusion Markup Language
ColdFusion Markup Language, more commonly known as CFML, is a scripting language for web development that runs on the JVM, the .NET framework, and Google App Engine. Multiple commercial and open source implementations of CFML engines are availab ...
(*.cfm)
*
Go (*.go)
*
Google Apps Script
Google Apps Script is a scripting platform developed by Google for light-weight application development in the Google Workspace platform. Google Apps Script was initially developed by Mike Harm as a side project while working as a developer on G ...
(*.gs)
*
Hack
Hack may refer to:
Arts, entertainment, and media Games
* ''Hack'' (Unix video game), a 1984 roguelike video game
* ''.hack'' (video game series), a series of video games by the multimedia franchise ''.hack''
Music
* ''Hack'' (album), a 199 ...
(*.php)
*
Haskell
Haskell () is a general-purpose, statically-typed, purely functional programming language with type inference and lazy evaluation. Designed for teaching, research and industrial applications, Haskell has pioneered a number of programming lan ...
(*.hs) (example:
Yesod
Yesod (Hebrew: יְסוֹד ''Yəsōḏ'', Tiberian: ''Yăsōḏ'', "foundation") is a sephirah or node in the kabbalistic Tree of Life, a system of Jewish philosophy. Yesod, located near the base of the Tree, is the sephirah below Hod and Ne ...
)
*
Java
Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mo ...
(*.jsp, *.do) via
JavaServer Pages
Jakarta Server Pages (JSP; formerly JavaServer Pages) is a collection of technologies that helps software developers create dynamically generated web pages based on HTML, XML, SOAP, or other document types. Released in 1999 by Sun Microsystems, J ...
*
JavaScript
JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of Website, websites use JavaScript on the Client (computing), client side ...
using
Server-side JavaScript (*.ssjs, *.js) (example:
Node.js)
*
Lasso
A lasso ( or ), also called lariat, riata, or reata (all from Castilian, la reata 're-tied rope'), is a loop of rope designed as a restraint to be thrown around a target and tightened when pulled. It is a well-known tool of the Spanish a ...
(*.lasso)
*
Lua
Lua or LUA may refer to:
Science and technology
* Lua (programming language)
* Latvia University of Agriculture
* Last universal ancestor, in evolution
Ethnicity and language
* Lua people, of Laos
* Lawa people, of Thailand sometimes referred t ...
(*.lp *.op *.lua)
*
Parser
Parsing, syntax analysis, or syntactic analysis is the process of analyzing a string of symbols, either in natural language, computer languages or data structures, conforming to the rules of a formal grammar. The term ''parsing'' comes from Lati ...
(*.p)
*
Perl
Perl is a family of two High-level programming language, high-level, General-purpose programming language, general-purpose, Interpreter (computing), interpreted, dynamic programming languages. "Perl" refers to Perl 5, but from 2000 to 2019 it ...
via the
CGI.pm
CGI.pm is a large and once widely used Perl module for programming Common Gateway Interface (CGI) web
Web most often refers to:
* Spider web, a silken structure created by the animal
* World Wide Web or the Web, an Internet-based hypertext ...
module (*.cgi, *.ipl, *.pl)
*
PHP
PHP is a General-purpose programming language, general-purpose scripting language geared toward web development. It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1993 and released in 1995. The PHP reference implementati ...
(*.php, *.php3, *.php4, *.phtml)
*
Python (*.py) (examples:
Pyramid
A pyramid (from el, πυραμίς ') is a structure whose outer surfaces are triangular and converge to a single step at the top, making the shape roughly a pyramid in the geometric sense. The base of a pyramid can be trilateral, quadrila ...
,
Flask,
Django)
*
R (*.rhtml)
*
Ruby
A ruby is a pinkish red to blood-red colored gemstone, a variety of the mineral corundum (aluminium oxide). Ruby is one of the most popular traditional jewelry gems and is very durable. Other varieties of gem-quality corundum are called sapp ...
(*.rb, *.rbw) (example:
Ruby on Rails
Ruby on Rails (simplified as Rails) is a server-side web application framework written in Ruby under the MIT License. Rails is a model–view–controller (MVC) framework, providing default structures for a database, a web service, and web ...
)
*
Tcl
TCL or Tcl or TCLs may refer to:
Business
* TCL Technology, a Chinese consumer electronics and appliance company
** TCL Electronics, a subsidiary of TCL Technology
* Texas Collegiate League, a collegiate baseball league
* Trade Centre Limited ...
(*.tcl)
*
WebDNA
WebDNA is a server-side scripting, interpreted language with an embedded database system, specifically designed for the World Wide Web. Its primary use is in creating database-driven dynamic web page applications. Released in 1995, the name was r ...
(*.dna,*.tpl)
*
Progress WebSpeed (*.r,*.w)
See also
*
Client-side scripting
A server-side dynamic web page is a web page whose construction is controlled by an application server processing server-side scripts. In server-side scripting, parameters determine how the assembly of every new web page proceeds, and includi ...
*
Content management system
A content management system (CMS) is computer software used to manage the creation and modification of digital content ( content management).''Managing Enterprise Content: A Unified Content Strategy''. Ann Rockley, Pamela Kostur, Steve Manning. New ...
(CMS)
*
Edge Side Includes
*
JSP
*
Node.js
*
Next.js
*
Outline of web design and web development
*
Perl/Plack
*
PHP
PHP is a General-purpose programming language, general-purpose scripting language geared toward web development. It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1993 and released in 1995. The PHP reference implementati ...
*
Server Side Includes
Server Side Includes (SSI) is a simple interpreted server-side scripting language used almost exclusively for the World Wide Web. It is most useful for including the contents of one or more files into a web page on a web server (see below), using i ...
(SSI)
*
Web development
Web development is the work involved in developing a website for the Internet (World Wide Web) or an intranet (a private network). Web development can range from developing a simple single static page of plain text to complex web application ...
References
External links
* ;
{{DEFAULTSORT:Server-Side Scripting
Scripting languages