---
title: "Tech Tip #17: Serve static sites from the edge"
description: "A page view shouldn't need a database."
url: https://greencode.ai/tech-tips/17-cache-and-compress-at-the-edge/
---

# Tech Tip #17: Serve static sites from the edge

**A page view shouldn't need a database.**

[Watch the video](https://media.greencode.ai/shorts/cache-and-compress-at-the-edge-972ac8e14614.mp4)

Video created by [explainapaper.com](https://explainapaper.com/?utm_source=greencode.ai&utm_medium=film&utm_campaign=made-by)

### The problem

Content sites often run an application server and a database for every page view, even though the pages change rarely.

### The fix you can use today

- Pre-render pages that rarely change as static files.
- Serve them from a CDN or edge network with long cache lifetimes.
- Keep server-side code only for things that really are dynamic, like forms.

GreenCode moved its own website from WordPress to static pages served from the edge.

### Tools that help

- [Greencheck](https://developers.thegreenwebfoundation.org/api/greencheck/v3/check-single-domain/?utm_source=greencode.ai&utm_medium=referral&utm_campaign=greencode) (Green Web Foundation): checks whether a domain is hosted on renewable-powered infrastructure
- [CO2.js](https://developers.thegreenwebfoundation.org/co2js/overview/?utm_source=greencode.ai&utm_medium=referral&utm_campaign=greencode) (Green Web Foundation): an open-source library that turns bytes transferred into an estimate of CO2, using the Sustainable Web Design model
- [WebPageTest](https://www.webpagetest.org/?utm_source=greencode.ai&utm_medium=referral&utm_campaign=greencode): loads a real page and shows every request, its size and when it loaded

### How GreenCode helps

GreenCode helps tackle this by proving it on greencode.ai first: static pages on an edge network, WebP images and scripts only where used. A first view of the home page fell from 6,766 KB over 80 requests to 1,719 KB over 33. [More on this](https://greencode.ai/green-hosting/).

### Tags

#cdn#caching

### Sources

- [Green hosting: static delivery, nothing computed per request except forms](https://greencode.ai/green-hosting/)
- [Sustainable Web Design, Guideline 4.10: use CDNs when beneficial](https://sustainablewebdesign.org/guidelines/4-10-use-content-delivery-networks-cdns-when-beneficial/?utm_source=greencode.ai&utm_medium=referral&utm_campaign=greencode)
- [W3C, Web Sustainability Guidelines: deliver static content in place of dynamic wherever possible](https://www.w3.org/TR/web-sustainability-guidelines/#static-over-dynamic)

[All GreenCode Tech Tips](https://greencode.ai/tech-tips/)

#### Key Facts

- Tip **#17**
- For **Ops and infrastructure**
- Category **Web and front-end**
- Format **short video**
![GreenCode](https://greencode.ai/wp-content/uploads/2024/12/greencode-logo-website-small-colours-2.webp)

Want this checked on your own system? Talk to the GreenCode team.

[Get in touch](https://greencode.ai/contact/)
