Static vs dynamic websites: what the difference means for you
A static site serves pages built in advance; a dynamic site builds each page when it is requested. What that means for speed, cost, security and editing.
By Sohail Hussain21 November 20266 min read
A static website serves pages that were built in advance and stored as finished files, so every visitor gets the same file straight from a server or CDN. A dynamic website builds each page at the moment someone requests it, by running code and reading a database. For most company websites, static (or mostly static) is the better choice: it is faster, cheaper to host and harder to attack. Dynamic is needed when pages depend on who is looking or on data that changes by the second: logins, dashboards, live stock, personalised prices.
The distinction matters less than it used to, because modern sites mix the two. The useful question is which parts of your site need to be dynamic, and whether the rest can be served as files. When we plan a site as part of our website design and development work, that question is answered page by page.
What actually happens when someone opens a page?
On a static site, the HTML for each page already exists. It was produced when the site was last built or published. When a visitor arrives, a CDN server near them sends the file. Nothing is calculated. This is why static pages load quickly even on cheap hosting: the server's job is the same as serving an image.
On a dynamic site, a request reaches an application server. Code runs (PHP for WordPress, Node.js for many modern apps), fetches content from a database, assembles the HTML and sends it. This takes longer, and the server has to do it for every visitor unless a cache steps in.
Static does not mean unchanging. A static site connected to a content management system rebuilds the affected pages when an editor publishes. The visitor still gets a file; the file is just replaced when the content changes.
How do static, dynamic and hybrid sites compare?
| Static | Dynamic | Hybrid (static pages, dynamic parts) | |
|---|---|---|---|
| How pages are made | Built in advance, served as files | Built on each request | Most pages pre-built; some parts built per request |
| Speed | Very fast from a CDN | Depends on server and caching | Fast for most pages |
| Hosting cost (as of October 2026) | Free to a few dollars a month at low traffic | ₹300 to ₹4,000 or $5 to $50 a month for a typical site | Free to $20 a month at low traffic on platform hosts |
| Security | Very small attack surface | Server, database and admin are exposed | Small; only the dynamic parts need protecting |
| Content updates | Rebuild on publish, seconds to minutes | Instant | Instant or near-instant |
| Personalisation and logins | Only in the browser | Full | Where needed |
| Examples | Brochure sites, documentation, portfolios | Web apps, dashboards, forums, uncached WordPress | Most modern Next.js company sites |
For the hosting figures, our website hosting cost calculator estimates bandwidth and cost from your own traffic.
Why are static pages faster and safer?
Speed. Serving a file from a CDN edge server close to the visitor removes two slow steps: running code and querying a database. The first byte arrives sooner, which helps Largest Contentful Paint, one of Google's Core Web Vitals. A dynamic site can approach the same speed with full-page caching, but only for pages that are cached, and only until the cache expires or someone logs in.
Security. A folder of HTML files has nothing to exploit: no admin login on the same server, no plugins, no database connection. Outdated plugins and weak admin passwords are the usual ways into a dynamic CMS. A static site has neither.
Cost and reliability. Static files are cheap to serve and easy to cache everywhere. A traffic spike, such as a press mention or a campaign, costs bandwidth but does not overload a database. Dynamic sites need servers sized for the peak, or they slow down when it arrives.
When does a site need to be dynamic?
Some content cannot be built in advance, because it depends on the request:
- Logged-in areas: client portals, account pages, dashboards.
- Data that changes constantly: live inventory, prices that vary by customer, availability calendars.
- Very large catalogues that change often: rebuilding 200,000 product pages on every stock change is impractical, so those pages render on request and are cached briefly.
- Search results and filtered listings: the combinations are endless, so they are computed when asked.
- Forms, payments and anything that writes data: always handled by server code.
A company website usually has a few of these (a form, perhaps a search) and a lot of pages that are the same for everyone. That is the case for a hybrid.
What does a hybrid site look like in practice?
Frameworks such as Next.js decide per page, and even per part of a page. Service pages, case studies and blog posts are pre-rendered and served from a CDN. When an editor publishes a change, only those pages are regenerated. The contact form posts to a server function. A client login area renders on request. This is how most of the Next.js sites we build are set up, and it is a large part of the case we make in why we build company websites with Next.js.
A fully static export is also possible. Next.js can export a site as plain HTML files that run on any web host, with some features removed. The Next.js static exports documentation lists what stops working without a server, including server-side redirects and headers, incremental regeneration, default image optimisation and Draft Mode. For a five-page site that will rarely change, a static export on free hosting is a perfectly good answer.
WordPress is the opposite starting point: dynamic by default, made faster with page caching. That works, and it is how most well-run WordPress sites stay quick. The trade-off is that the dynamic machinery, and its security exposure, is still there behind the cache. We compare the two approaches in WordPress vs custom website.
Which should you choose?
Start from your pages, not the technology.
- List the pages that are the same for every visitor. On a company site, this is usually almost all of them. These should be static or pre-rendered.
- List the features that depend on the visitor or on live data. Forms, search, login, prices. These need server code, but only for that feature.
- Decide how fast content must appear after publishing. Seconds is fine for nearly every company site, which a static or hybrid setup handles. If a change must be live the instant it is saved, as in a newsroom, a dynamic CMS is simpler.
- Check who will maintain it. A static site needs almost no upkeep. A dynamic CMS needs regular updates; see website maintenance for what that involves.
Not worth doing: rebuilding a working WordPress site as static purely for speed, if a caching plugin and better hosting would get you most of the way for a fraction of the cost. Try that first. If you have already tuned it and it is still slow, or it keeps getting attacked, that is the point to change. Our comparison of Vercel, Netlify and Cloudflare Pages covers where a static or hybrid site would live.
Was this guide useful?