Urgent.News

What's breaking now, across thousands of outlets.

Tech

Extreme Server Side Rendering

The article discusses extreme server side rendering (XSSR), a technique that aims to create responsive web applications without relying on JavaScript. To understand XSSR, the author first explains the two main types of server side rendering (SSR): old-school and new-school. Old-school SSR involves the server dynamically generating HTML based on incoming requests, without any corresponding static HTML files.

New-school SSR adds a bit of front-end JavaScript logic to handle interactions with the page, allowing for dynamic content updates.

The author then explores the HTTP server protocol, which involves sending ASCII text containing headers and HTML content one character at a time. By sending HTML slowly, similar to human typing, the page can render as new HTML arrives, and CSS can even be used to manipulate elements on the page. This opens up the possibility of updating the page from the server side without JavaScript.

The author discusses the challenge of accepting user input without reloading the page, which is typically done using form elements. However, using a hidden iframe to reload the page upon form submission can make user input seamless. The author also introduces the concept of generating a unique identifier (UUID) for each page load to tie events to the original page, preventing user confusion.

The author concludes by demonstrating an example of XSSR in action: a Flappy Bird clone clone, which runs entirely in the back-end with no front-end JavaScript required. The author notes that the site performs well, with significant bandwidth savings compared to a traditional JavaScript-based application. However, the latency increases depending on the user's geographic location due to the round trip required for each action.

Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at scd31.com →

More in Tech

More from Tuesday 8 September →