01 / 08 Hosting guide
Static, edge or server: where should your website or app run?
Most hosting bills and many outages come from running more than the product needs. Decide first how much of each page can be built ahead of time, then give a server only the part that is left.
Written by Iavor Kolev, software architect and product builder
82
pages on this site, built ahead of time and served as static files
1
server function on this site: the endpoint that records conversion events
100
Lighthouse performance on mobile and desktop in its December 2026 test run
02 / 08 Principle
Build ahead what you can, run per visit only what you must
A page built ahead of time has nothing to crash, nothing to patch and nothing to scale.
Hosting is often chosen by habit: a server because the last project had one, or a platform because it was popular that year. The better starting point is the product itself. Which pages look the same for every visitor? Which parts must react to a request? Does anything have to keep running between visits?
Pages that look the same for everyone can be built once and served as files from a global network: fast, cheap and hard to break. Small reactions to a request fit a function at the edge. Only work that has to keep running, such as background jobs, live connections or a busy database, needs a server, and that is where the upkeep and most of the cost sit.
03 / 08 Options
Three places a product can run
Most products use more than one. The skill is putting each part in the cheapest place that can carry it.
Static files
Pages built once and served from a global network
This site renders every page to HTML when it is built, and Cloudflare Pages serves the files. Nothing runs per visit, so there is nothing to crash under traffic. This fits websites, landing pages, documentation and guides.
Edge functions
Small pieces of code close to the visitor
For the parts that must react to a request: a form, a redirect, a small API. This site runs one, the endpoint that records conversion events, and it accepts only a fixed list of fields. Webwify's contact form runs as Rust compiled to WebAssembly at the edge.
A server
A process that keeps running
Needed for long-running work, background jobs, live connections or a database the code talks to all the time. Managed platforms such as Vercel, Netlify or a managed PostgreSQL like Neon remove most of the upkeep. A conventional server gives the most control and needs the most maintenance.
If a page looks the same for every visitor, it should not need a server to show it.
04 / 08 Security
Security settings worth adding on any host
The host gives you HTTPS. These four settings close the gaps it leaves open, and none of them costs speed.
01 / HTTPS
Never fall back to an unencrypted connection
This site tells browsers to use HTTPS for a year, including every subdomain, so a visitor is never sent to an unencrypted page.
02 / Scripts
Allow only your own scripts
A content security policy lists where scripts, styles and connections may come from. This site allows scripts only from its own domain, and its build check fails if an inline script appears.
03 / Framing
Stop other sites from embedding yours
Two headers forbid other sites from showing these pages inside a frame, which blocks tricks that hide a real page under a fake one.
04 / Previews
Keep test copies out of search
Preview deployments and the platform's default address are marked noindex, so search engines find only the real domain.
05 / 08 Caching
Caching that is fast for visitors and never stale after a release
Caching too little makes a site slow. Caching the wrong file makes visitors see an old version after a release.
Hashed files
Cache forever what changes its name when it changes
This site names its stylesheet after a hash of its content, so browsers may keep it for a year. A release with new styles produces a new file name, and the old copy is never used again.
Pages
Check the HTML on every visit
Pages are served with a rule that makes the browser ask for a newer version each time. When nothing changed, the answer is tiny, and a release is visible at once.
Fixed names
Never cache a fixed file name for long
Scripts that keep the same name across releases are checked on every visit too. On this site only files with a content hash in their name may be cached as unchanging.
06 / 08 Release
Release through checks, not by hand
Most production problems are shipped, not caused by the host. A release that must pass checks first catches them before visitors do.
Tests
The full test suite runs on every release
On this site that means the Rust tests and browser tests on desktop and mobile screens, plus formatting and code checks.
Dependencies
Known vulnerabilities stop the release
A security audit of every dependency runs before each deploy, for both the Rust and the JavaScript side.
Speed
A slow build does not ship
Lighthouse tests the homepage and a service page on mobile and desktop, and a score under its threshold stops the release.
After deploy
The live site is checked again
After the deploy, the checks run once more against the real address, and the changed pages are sent to search engines through IndexNow.
07 / 08 Evidence
Where this approach runs
Two products built static-first, with server code only where a request needs it.
- Case studyiavorkolev.comThe site you are reading: 82 static pages in two languages on Cloudflare Pages, one edge function and a release that has to pass its checks.->
- ProjectWebwifyPages that measured 0.0 KB of JavaScript in August 2026, and a contact form that runs as Rust compiled to WebAssembly at the edge.->
- ServiceHosting, databases and deploymentHosting, caching and release setups shaped around the product.->
08 / 08 Next step
Answer these five questions before choosing hosting
The answers decide how much of the product needs a server, and that decides most of the cost and upkeep.
Five questions
- Which pages look the same for every visitor, and can they be built ahead of time?
- What has to run on each request, and could it be a small function instead of a server?
- Does anything need to keep running: background jobs, live connections, a busy database?
- Who applies security updates, and how quickly?
- What checks run before a release reaches visitors, and which of them can stop it?