Running dynamic websites that use complex content management systems benefit from quick loading times. This is because they ensure good performance and therefore increase user-friendliness. With the release of PHP7, a new scripting language is now available with which the loading times of your own website can be significantly shortened compared to the older script version.
The internet has always been based on one simple principle: all kinds of content is provided by web servers and can be received by clients via HTTP or FTP. Clients are browsers, of which the best-known ones include Mozilla Firefox and Google Chrome. These can be installed and used on the user’s system. Web servers such as Apache and NGINX, on the other hand, are components of web projects; these are also installed and run in this environment and allow the respective client access to the content.
While static content like typical HTML elements and images can easily be transferred and displayed, dynamic content such as a Wiki, a drop-down menu, or a web application, will only function with scripts. These must be executed and interpreted with the appropriate scripting language, which can either occur server-side or client-side. For this reason, a distinction must be made between server-side scripting and client-side scripting.
What is server-side scripting?
Server-side scripting is a technique that is used to develop websites and implement dynamic elements and web applications. It’s based on the use of scripts that are carried out by the web server using the appropriate scripting languages when a client requests the corresponding content. The script’s task is often to retrieve the appropriate data from a database and integrate it into the web project. The user accesses these via HTML pages, while the script source codes remain completely hidden. The use of server-side scripts requires the client to send multiple requests to the web server to provide the user with new information. This means, on the one hand, high utilisation of the server's capacity, which has an impact on the response time of the web server, and on the other hand, that an existing connection to the server is indispensable for making use of the web offer.
In the early days of the World Wide Web, server-side scripting was almost exclusively implemented by writing developer programs in C, as well as Perl and command line scripts. These applications were carried out and interpreted by server operating systems, at which time the result could be passed from the web server to the browser via the common gateway interface (CGI). Many modern web servers can now also run scripts directly, i.e. using corresponding modules. Launched in 1995 and based on C and Perl, PHP is the most widely used server-side scripting language today. The following table shows a selection of the programming languages used for server-side scripts:
Yukihiro Matsumoto etc.
Larry Wall etc.
Guido van Rossum, Python Software Foundation
GNU GPL and Artistic License
Python Software Foundation License
procedural, modular, also partly object-orientated
imperative, functional, object-orientated
What is client-side scripting?
Client-side scripting is another technique used by web developers to create projects with dynamic content. Unlike the server-side variant, however, the client executes and processes the programmed scripts, not the server. For this purpose, the scripts are either embedded into the HTML or XHTML document, or written into a separate file linked to the document. If the user now tries to access a webpage or application with such a client-side script, the web server sends the HTML document and the script to the browser, which performs the same execution, presenting the final result. Client-side scripts can also contain concrete instructions for the web browser, determining how it should react to users’ actions, e.g. clicking on a button. Often, the client doesn’t need to re-establish a connection to the web server.
As the scripts are executed in the user’s browser, the user has the option to view the source code – unlike with server-side scripts. In turn, the interpretation of the scripts requires the corresponding script language to be understood by the web browser. There are also various browser extensions available, which can block scripts, as client-side scripting applications, such as pop-ups and web-tracking tools, can have a negative impact on the loading times.
Client-side scripting vs. server-side scripting