A site is static when the server does no work per request: every visitor asking for the same path gets the same bytes off a disk. Nothing is assembled, nothing is looked up, nothing changes because of who is asking.
That is the whole definition, and it says nothing about how the page behaves once it is open. A static page can fetch data, run an entire application, animate, save things, and talk to APIs — because all of that happens in the visitor's browser, after the file has been delivered. The line is not "does the site do things"; it is does the server have to do things to answer.
The practical test is one question: could this site be a folder of files on a USB stick, served by something that only knows how to hand out files? If yes, it is static, and every static host will take it. If no, no amount of configuration on a static host will change that, and the sooner you know the better.
Static, even though it does not look it
People rule themselves out of static hosting for things that are fine:
- JavaScript that calls an API. The API runs somewhere else. Your site is still a folder.
- A single-page app — React, Vue, Svelte. The build produces HTML, CSS and JS. That is a folder. (It needs one host setting so deep links work; that is a separate problem with a one-line fix.)
- A form, if something else receives the submission — a form service, a host that collects them for you, an endpoint you already run.
- Search, when the index is built at build time and queried in the browser. Most documentation sites work this way.
- Comments, analytics, chat widgets, payment buttons. All third-party embeds. Your server does nothing.
- Content that changes daily, as long as it changes by rebuilding and republishing rather than per request. A blog rebuilt on every post is static.
- Thousands of pages. A generator emitting ten thousand HTML files is still emitting files.
Not static, whatever it looks like
The list is shorter and it is about the server, not the page:
- Anything rendered per request. If the HTML depends on who is asking — a dashboard, a personalised feed, "Hello, Ana" in the header from a session — a server has to build it.
- Logging in. Not the form, the session. Checking a password and keeping somebody signed in is server work. (A single shared password on the whole site is different: that is a gate in front of the files, and some hosts do it at the edge.)
- Writing to a database. Reading one at build time is fine. Writing to one when a visitor acts is not, unless something else does the writing.
- Secrets. If your page needs a key the visitor must not see, it cannot be in the files. Anything shipped to the browser is public, minified or not.
- Server-side redirects with logic, rate limiting, IP rules, geolocation — anything that inspects the request and decides.
- Work done on demand: resizing an image per request, generating a PDF, proxying an API to hide a key.
- Receiving webhooks. Something has to be listening.
Where the frameworks land
| Framework | Output |
|---|---|
| Hugo, Jekyll, Eleventy | Static. That is the whole job |
| Astro | Static by default; server output only if you opt into it |
| Vite / CRA / Vue CLI app | Static files, plus one deep-link setting on the host |
Next.js with output: 'export' |
Static |
| Next.js otherwise, Nuxt with SSR, SvelteKit with a node adapter | Not static — a server renders per request |
| Docusaurus, VitePress, MkDocs | Static |
| WordPress | Not static, unless you export it to HTML |
The pattern: a framework is static when its build produces a directory you could copy anywhere. If the build produces a server, you need somewhere to run it.
Five things people discover late
Environment variables are not secrets. A build-time variable inlined into your bundle is a string in a file anyone can read. Framework prefixes like VITE_ or NEXT_PUBLIC_ exist to make that obvious; the ones without a prefix are still readable if the bundle contains them. The rule is simple: if it is in the build output, it is public.
CORS becomes your problem. Your page now lives on a different origin from your API, so the API has to say your origin may call it. This surprises people who had both on one server.
API keys cannot be hidden by hiding them. Calling a paid API straight from the browser means shipping the key. If the key must stay private, something server-side has to hold it — which does not mean your site cannot be static, only that this one call has to go through something else.
Redirects and headers are host features. There is no .htaccess in a bucket. Each host has its own file or setting for redirects, custom headers and caching, and they do not transfer between hosts.
"Just protect it with JavaScript" protects nothing. A password prompt drawn by your own page is a suggestion: the files are already downloaded, and anyone can read them. Real protection has to happen before the files are sent — either at the host or in a server in front of them.
If it turns out you are not static
The usual answer is not "give up on static hosting". It is: move the dynamic part somewhere else, and keep the site a folder.
- A form → a form service, or a host that collects submissions.
- A private API call → a small function or service that holds the key, called by your page. Several static hosts — this one included, on its larger plans — run that function beside the pages (how it works here).
- Login → an authentication provider, with your pages staying public and the data behind an API.
- Personalised content → fetch it in the browser after load, rather than rendering it into the HTML.
What you get for that separation is the reason static hosting is worth the trouble: files on a CDN cannot be slow under load, cannot be exploited server-side because there is no server, and cost roughly nothing to serve.
If your folder turns out to be static after all, here is what people put in one — and what a folder of Markdown or PDFs becomes without a generator in the way.
Questions
Is a static site less capable? Less capable on the server, not in the browser. Most of what people mean by "a website" — pages, images, an app, a form, search, analytics — is either a file or something the browser does.
Is it faster? Usually, and for a structural reason rather than an optimisation: there is nothing to compute, so a request is a cache lookup. A slow static site is a slow page — too much JavaScript, unoptimised images — not a slow server.
How do I know what my build produced?
Look at the output directory. If it is .html, .css, .js and images, that is a folder and you are done. If it contains a server entry point your host is supposed to run, you are not static.
Can a static site have a blog with comments? Yes. The posts are files, and comments come from an embedded service or an API your page calls. The page is static; the conversation is not stored in it. Comments from the people reviewing a draft are a different job from a comment section for readers, and several static hosts — this one included — let reviewers pin them to the page with nothing added to your files (how that works here).
What about SEO — do search engines read JavaScript? Google generally does, others less reliably, and all of them prefer content that is in the HTML. If search matters, prefer a framework that emits real HTML per page over one that renders an empty shell and fills it in afterwards.