Docs

Static sites

Sites that build to plain files skip containers entirely — built once, served from the edge.

When a build produces a static output directory (Astro without an SSR adapter, Vite, CRA, Gatsby, plain HTML), Buildfyio publishes the files to the edge file server instead of building a container. Deploys are atomic — the new release swaps in as a single symlink flip — and rollbacks are instant.

What you get

  • No cold starts, no instance costs — static sites don't consume compute.
  • Atomic releases and instant rollbacks.
  • Web analytics injected into every published page automatically — see Analytics.
  • Custom domains and TLS exactly like container apps.

Build settings

Detection fills the build command (astro build, vite build, …) and the output directory (dist, build). Dependencies — including devDependencies, where build tooling usually lives — are installed before the build runs; workspace members install from the repository root.

Static vs SSR — decided by the build

The static/container decision follows what your build actually produces, not the framework name. An Astro site with an SSR adapter (@astrojs/node) builds a server and runs as a container automatically; the same repo with output: 'static' publishes to the edge. Nothing to configure.

404 page, compression, headers

A path that does not exist answers 404 with your 404.html as the body when the build produced one (Astro, Next export, Eleventy and most generators do). Responses are compressed with gzip or zstd according to Accept-Encoding(brotli is not available). Every static site sends these headers unless you override them:

Strict-Transport-Security: max-age=63072000
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
Referrer-Policy: strict-origin-when-cross-origin
Permissions-Policy: camera=(), microphone=(), geolocation=()
Cache-Control: public, max-age=31536000, immutable   # /_astro/*, /assets/*, /_next/static/*

_headers and _redirects

Put a _headers and/or _redirects file in your output directory (the Netlify / Cloudflare Pages format; most frameworks copy public/ there). They are applied at the edge on the next deploy and are never served themselves.

# _headers
/*
  X-Frame-Options: DENY
  Content-Security-Policy: default-src 'self'
/downloads/*
  Cache-Control: no-store

# _redirects            from  [param=value …]  to  [status]
/old-page/              /new-page/                     301
/blog/*                 /news/:splat                   301
/hizmetlerimiz/  cat=vergi  /hizmetlerimiz/kategori/vergi/  301
/legacy-api/*           /api/:splat                    200   # rewrite, URL unchanged

Status defaults to 301; 200 rewrites instead of redirecting. Whole-host redirects (apex → www) are a domain setting: buildfy domains redirect example.com www.example.com.

Environment variables in static builds

A static build runs on the build machine and only the output directory is published, so it receives every variable of the target, secret-marked ones included — there is no image for a secret to end up in. Whether a value reaches the browser is up to your framework (PUBLIC_*, VITE_*, NEXT_PUBLIC_* are inlined by design). Container builds differ: plain variables are build arguments, secrets arrive through a BuildKit secret mount and never land in a layer.

SPA routing

Client-side routed apps (React Router, Vue Router) serve index.html for unknown paths, so deep links resolve.