Low-energy computing
Links:
- Introducing Carbon Computing - Branch
- Home - The Green Web Foundation
- Calculating Digital Emissions - Sustainable Web Design
- CloudFront Analytics
Eleventy + JS Islands
- A way to load a script for single page? · 11ty/eleventy · Discussion #2506 · GitHub
compiling vs rendering
Javascript is necessary for post-render interactivity beyond what the browser can support with native features (which, you should refresh yourself on; there's quite a lot!). But right now, we use JS to not just provide the interactivity, but to render the structure, content and style of the page itself. There are many cases where this is necessary, but many more where it does not - a good portion of this client-side rendering is simply rendering the same, static page for all users. It begs the question - why?
Let's consider two identical pages, full of rich, styled content and limited interactivity. Think a new site, a blog, or a website of documentation.
- If the website is rendered using a javascript framework, either server-side rendered or on the client, a file (or files) are transferred to the viewer upon view, and code is executed to create the page. The browser then parses and displays the page to the viewer.
- If the website is static files, the website is either written or built (for example by a static site generator) every time the website changes, but when a viewer visits the page, a file is transferred that the browser can parse and display directly.
If that same page is updated 100 times across the day (let's use the news website homepage example - they're publishing articles throughout the day ), and daily readership is 1M, in example 1, the website is "built" 1M times. In example (2), the website is built 100 times.
Compiled 2024-04-21