---
title: "Host a static site: the while.sh docs"
url: https://while.sh/en/docs/building-blocks/static-site/
updated: 2026-11-21
---

# Static sites

A site with no server, made of HTML and JavaScript: while builds it if needed, then serves it over HTTPS, with the right cache for each file and your own headers.

> You, to your AI: Deploy the event's website.

## What your agent writes

Your agent writes it in while.yaml, at the root of your app:

```yaml titre="while.yaml"
apiVersion: while/v1
project: my-app
services:
  - name: site
    type: static
    root: dist
```

## When to use it

For a site without a server, made of built HTML and JavaScript.

## How it works

while builds the site if `package.json` has a build script, then serves the `root` folder: HTML revalidated on every visit, fingerprinted files (`/_astro/`, `/assets/index-a1B2c3D4.js`…) kept for a year, everything else for an hour. A .gz file already built next to a file is sent compressed. A `_redirects` file at the root redirects exact paths (`/old /new 301`, 50 at most); a `_headers` file sets headers per path (`/*` then an indented `Content-Security-Policy: …`).

## What to know

The site is served without a container: while keeps its files, nothing sleeps, and it reserves neither CPU nor memory. Its traffic is included, up to 1 TB per month per organization. A version holds at most 20,000 files and 2 GiB, a single file 100 MiB; versions are kept for 14 days, and at least the last 10. A site deployed before this service joins it at its next deployment. To track visitors' JavaScript errors, `SENTRY_DSN_PUBLIC` is set during the build. Copy it in the build script under the prefix the bundler exposes to the browser (PUBLIC_ for Astro, VITE_ for Vite, NEXT_PUBLIC_ for Next.js): "build": "`PUBLIC_SENTRY_DSN`=$`SENTRY_DSN_PUBLIC` astro build".

## Pricing

These prices are the same on every plan, excluding VAT:

| Resource | Price | Details |
|---|---|---|
| CPU and memory | €17 per vCPU per month, €8.50 per GiB per month | tools by usage, caches by reservation |

## Guides

- [Deploy a static site with Astro, Vite or HTML with your AI, over MCP (2026)](/en/guides/deploy-static-site/)
