There are a few different ways to create websites. This article presents three of them for a brief introduction.
The simplest implementation is to create a static web site. In this implementation, the web server returns a static HTML page with a response to a browser’s HTTP request. The static web pages have the same presentation and content, regardless of user identity or other factors. It is easy to generate a static web page; however, it is limited to what we can do with it since the page always displays the same thing. For example, if we click, say, www.staticpage.com, in a browser, we get the same content every time we click the link.
See the picture below.
![](https://static.wixstatic.com/media/f9fef1_d156da899108482a86be8eaffe9bb37e~mv2.png/v1/fill/w_599,h_224,al_c,q_85,enc_auto/f9fef1_d156da899108482a86be8eaffe9bb37e~mv2.png)
Static website
If we want to have a more useful and diverse web site, we need to create a dynamic website. In this case, the web server returns a dynamic HTML page instead of a static web page. A dynamic web page contains customizable content, according to a user identity or other factors. It typically uses a storage media to store the data such as a database. For example, if we click www.yahoo.com, the content is always updated and display different material.
This mechanism uses a server-side rendering.
The two methods introduced above are rather traditional. A recent model is called a single page application. The problem of the dynamic approach above is a performance. The server needs to gather data from storage media and generate HTML pages and the transactions go through an internet each time the page is requested. Let say if we have 100 web pages on your website. In general, there will be 100 HTTP transactions between a client and a server.
The motivation of the single page application is to reduce the latency with the server-side rendering. When a client requests a page from a website, the single page application initially returns with necessary items such as HTML, CSS, JavaScript, etc. After the initial load, the page rendering occurs on the client-side. Therefore, no HTML are generated on the server-side. Most of the transactions between the client and the server, therefore, will be data only.
This client-side rendering reduces the latency introduced by the multiple HTTP traffics and the server-side rendering. A single page application uses client-side rendering.
The recent trend, however, is to generate the initial page on the server-side to reduce the initial load time. Therefore, it is a mix of client and server-side rendering. The problem of this approach though, is a difficult implementation.
![](https://static.wixstatic.com/media/f9fef1_ec8dcce10eae47e4ab57d2c5c4b2a4b5~mv2.png/v1/fill/w_980,h_300,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/f9fef1_ec8dcce10eae47e4ab57d2c5c4b2a4b5~mv2.png)
Single Page Application
Comments