Every time you visit a website, your browser needs to render the site so that it is presented in an appealing way and provides the desired level of in­ter­activ­ity. However, depending on the web project’s pro­gram­ming approach, dynamic scripts and static code can be handled in very different ways. We’ll take a closer look at the three main ap­proaches: server side rendering, client side rendering, and static site gen­er­a­tion.

Server side rendering (SSR)

Server side rendering or server side scripting is a technique used in the de­vel­op­ment of websites with dynamic elements and web ap­plic­a­tions. It is based on the use of scripts that are executed by the web server using the ap­pro­pri­ate scripting languages when you request the cor­res­pond­ing content with the browser. With the initial request, all HTML, CSS, and JavaS­cript in­struc­tions are fully loaded.

Note

The source code of the scripts executed on the server side remains com­pletely hidden from the user!

In the early days of the World Wide Web, server side rendering was carried out almost ex­clus­ively by de­velopers writing programs in C and Perl and command line scripts. These ap­plic­a­tions were executed and in­ter­preted by the server operating system, after which the result could be trans­mit­ted from the web server to the accessing browser via the Common Gateway Interface (CGI).

Typical pro­gram­ming languages for server side rendering include:

  • Java
  • Ruby
  • ASP.NET
  • Perl
  • PHP
  • Python
  • Node.js or JavaS­cript

What are the ad­vant­ages of server side scripting?

A great advantage of SSR is that the web pages are preloaded by the server. A request is therefore processed almost im­me­di­ately from the user’s point of view, so the web pages end up being displayed very quickly. This approach to optimised loading speed is par­tic­u­larly useful for static websites. Search engines also see the fast page loading speed as a plus - also because crawlers can crawl pages more easily and more quickly thanks to server side rendering.

What are the dis­ad­vant­ages of server side rendering?

Server side scripting requires the server to deliver preloaded HTML pages with every request. In par­tic­u­lar, if a client con­tinu­ously sends further requests to the web server to provide the user with new, modified in­form­a­tion, this means a heavy load on the server capacity. SSR is therefore not suitable for websites that have a high number of requests or require a large number of user in­ter­ac­tions. In projects like these, the response time of the web server would negate the advantage of the optimised page loading speed.

Tip

A secure, stable, and high-per­form­ance hosting en­vir­on­ment lays the found­a­tion for the success of your web project. Choose web hosting from IONOS today and benefit from a scalable solution with the highest security standards and your own domain!

Client side rendering (CSR)

The technique of client side rendering or client side scripting is primarily used by web de­velopers to realise projects with dynamic content. In this case, the pro­grammed scripts are not executed and processed by the server, but by the accessing browser. For this purpose, the scripts are either embedded in the HTML or XHTML document or written in a separate file that is linked to the document.

When the user accesses a web page with client side scripts, the web server sends the HTML document and the scripts to the browser, which executes them itself and displays the final result. Client side scripts can also contain concrete in­struc­tions for the web browser on how it should react to certain actions by the user, such as when a button is clicked. Often, the client does not need to re-establish contact with the web server to do this.

The most sig­ni­fic­ant client side scripting language is JavaS­cript.

Note

The­or­et­ic­ally, any suitable scripting language can be used for client side rendering. However, in order for the project to be loaded by all different user groups later on, all relevant browsers would have to support them as well - a status that only JavaS­cript currently holds.

What are the ad­vant­ages of client side scripting?

CSR proves to be a prof­it­able approach, es­pe­cially for web projects with a lot of user in­ter­ac­tion. If the website initially loads slower, the sub­sequent rendering of further pages is therefore faster. The user ex­per­i­ence is sig­ni­fic­antly better than with server side rendering, since all scripts and content do not have to be loaded com­pletely right away every time the user visits a new page.

Since the scripts are executed in the user’s browser, they have the ability to view the source code, unlike server side scripts.

What are the dis­ad­vant­ages of client side rendering?

The focus on client side scripts comes with two key problems. First, it is harder for search engines to crawl and index the pages. Google’s crawlers are able to do this, even though the SEO con­di­tions are not optimal - es­pe­cially since many other search engines are often not able to index client side rendered pages at all.

On the other hand, client side scripting requires JavaS­cript to be supported by the browser. This is basically the case - but since pop-ups and tracking tools are also based on CSR and the client side scripts also in­flu­ences the loading time, there are various browser ex­ten­sions that block the scripts.

Static site gen­er­a­tion (SSG)

The trend of the past few years shows that websites are becoming more similar to apps in terms of their design. A high degree of re­spons­ive­ness and in­ter­activ­ity is just as important as a wide range of content. Users expect fast loading times and a seamless user ex­per­i­ence, where pages don’t always have to be loaded from scratch, for example. At the same time, website operators should not forget the im­port­ance of SEO and also try to do all that is possible for good Google rankings.

One approach that aims to combine the above re­quire­ments is static site gen­er­a­tion. With the help of static site gen­er­at­ors, HTML pages are created that use templates so they can be displayed at any time when a client starts a request. Unlike server side rendering, SSG rendering takes place in advance (before the client request), which keeps the page loading time as low as possible.

Popular static site gen­er­at­ors include the following:

  • Jekyll
  • Hugo
  • Next
  • Gatsby
  • Gridsome
  • Nuxt
  • Hexo
  • Eleventy
  • Jigsaw
  • Vuepress

What are the ad­vant­ages of static site gen­er­a­tion?

Static site gen­er­a­tion is es­pe­cially useful in projects that have a lot of content that does not change regularly. Typical examples include a personal website or blog, which typically carry little dynamic content and would benefit greatly from fast loading as a result of pr­er­en­der­ing (i.e., page pre­load­ing) by a static site generator. In addition, SSG projects offer few attack options since the risk potential is limited to the single click when the client’s page is loading.

Tip

Deploy static websites directly via GitHub? No problem - with Deploy Now from IONOS. Deploy your static websites from GitHub directly to a geo-redundant, DDoS-protected in­fra­struc­ture without build or bandwidth lim­it­a­tions!

What are the dis­ad­vant­ages of static site gen­er­a­tion?

There are a few downsides when it comes to pr­er­en­der­ing with SSG. The approach proves to be extremely im­prac­tic­al when a web project is subject to regular changes - whether of a technical nature or in terms of content. For each change, the static pages of the web project have to be ‘preloaded’ again. The larger the project, the more time this building process takes, making static site gen­er­a­tion un­suit­able for websites with a large number of static pages.

SSR vs. CSR vs. SSG: Summary

Server side rendering ensures an excellent page loading speed although this requires a lot of the web server’s capacity. Client side rendering is the opposite and actually relieves the server by rendering a large part of the page in the browser first - provided the user has not blocked JavaS­cript. Static site gen­er­a­tion spares both server and client and, thanks to the pr­er­en­der­ing approach, ensures fast delivery of the content, provided it is not in­ter­act­ive and con­stantly changing.

So, all three strategies presented for rendering web projects have their pros and cons. Decide which features best suit your project so you can find the best approach for your web ap­plic­a­tion.

Note

Good loading times, fast in­ter­activ­ity, and a stable layout are among the most important key figures of Google’s Core Web Vitals. You can find out whether you have chosen the right rendering strategy for your web project by looking at the ratings of the Google service, which is based entirely on user data.

Go to Main Menu