Static first
Static files need no app server for each request. Build them once, keep them in object storage, and cache them at the edge. Then 0 origin servers are necessary.
See it on the board
The same traffic runs on two boards. The simulator measured both when this page was built.
| Measure | Goal | An application server builds each page | Built files in object storage behind a CDN |
|---|---|---|---|
| p99 latency | under 150 ms | 68 ms Pass | 75 ms Pass |
| Error rate | under 0.1% | 0% Pass | 0% Pass |
| Monthly cost | 8 USD/mo | 1,045 USD/mo | |
| Level rules | none broken | Parts not allowed here Fail | Pass |
Key numbers
| Number | Value |
|---|---|
| Object store read, median | 30 ms |
| Edge cache read, median | 0.1 ms |
| Object storage price | 0.015 USD/GB-mo |
5 MB/s · logs kept on the host · disk full in 33 minutes
How it works
Many sites, such as documentation, do not change with each request. The page is the same for every reader. A dynamic server that builds the page on each request does work that you could do once.
The static design builds the files at release time. You store the built files in object storage, which is cheap and holds a lot, at 0.015 USD per GB-month. A CDN sits in front and caches the files at the edge. A read that hits the edge takes about 0.1 ms in the model, and one that misses reads the object store, at about 30 ms.
In the mini board the site is served without an origin server. The design may use only a CDN, edge functions and object storage, and it needs p99 below 150 ms and errors below 0.1 percent. An edge function can add light handling, such as a redirect or a header, and the origin server stays out of the design.
There is no server to patch, no capacity to plan and no single machine to fail. A traffic spike is absorbed by the CDN.
The limit is dynamic data. Personal pages and live data need a server, or the page must call an API from the browser after it loads. A mixed design serves the static shell first and fetches the dynamic parts later.
In the levels you replace the origin server with files in object storage and an edge cache.