# Static sites

> Files built once and served from the edge: landings, docs and single-page apps.

Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service).  
Source: https://run.docs.sypnia.com/apps/static-sites/

For agents: Static sites in Run: output uploaded to S3 under a per-deploy prefix, served by CloudFront; detection for Vite, Astro (no adapter), Next.js export, plain HTML; spa:true fallback to index.html; clean URLs; hashed assets cached 1 year, HTML revalidated; headers and redirects in the app's table of sypnia.toml; 404.html.

A static site is a folder of files: HTML, CSS, JavaScript, images. Run uploads it under the deploy's own prefix in Amazon S3 and serves it through Amazon CloudFront, so every visitor gets it from a location near them.

## What Run detects

| Your project                    | Build command | Output folder         |
| ------------------------------- | ------------- | --------------------- |
| Vite (React, Vue, Svelte)       | `vite build`  | `dist`                |
| Astro without an adapter        | `astro build` | `dist`                |
| Next.js with `output: 'export'` | `next build`  | `out`                 |
| Plain HTML                      | none          | the folder you deploy |

Set `build.command` and `build.output` in the app's table of `sypnia.toml` when your project is different.

## Behaviour

- **Single-page apps.** With `spa = true`, any path without a file answers `index.html`, so client-side routing works on refresh.
- **Clean URLs.** `/about` serves `about.html` or `about/index.html`.
- **Caching.** Files whose names carry a hash (`app.3f9c.js`) are cached for a year; HTML is revalidated on every request. A release changes which deploy answers, so visitors never mix files of two deploys.
- **Headers and redirects.** Declared in the app's table of `sypnia.toml` under `headers` and `redirects`, applied at the edge.
- **404.** `404.html` in the output is the not-found page.

## What it costs

Static sites use storage for each deploy's files and the bytes sent to visitors. [Credits and limits](https://run.docs.sypnia.com/cloud/credits-and-limits) lists what is metered.
