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?

StaticDynamicHybrid (static pages, dynamic parts)
How pages are madeBuilt in advance, served as filesBuilt on each requestMost pages pre-built; some parts built per request
SpeedVery fast from a CDNDepends on server and cachingFast 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 siteFree to $20 a month at low traffic on platform hosts
SecurityVery small attack surfaceServer, database and admin are exposedSmall; only the dynamic parts need protecting
Content updatesRebuild on publish, seconds to minutesInstantInstant or near-instant
Personalisation and loginsOnly in the browserFullWhere needed
ExamplesBrochure sites, documentation, portfoliosWeb apps, dashboards, forums, uncached WordPressMost 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.

  1. 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.
  2. 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.
  3. 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.
  4. 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?

Questions

Frequently asked.

Can a static website have a contact form?

Yes. The page is static, but the form sends its data to a small server function, a form service or your CRM. Most hosts for static sites, including Vercel, Netlify and Cloudflare, run these functions alongside the static pages. Visitors see no difference.

Can my team edit a static website without a developer?

Yes, if it is connected to a CMS. Editors change content in a browser, press publish, and the affected pages are rebuilt in seconds to a few minutes. The old idea that static sites need a developer for every text change dates from before headless CMS tools were common.

Is WordPress static or dynamic?

Dynamic. WordPress builds each page with PHP and a database query when it is requested. Caching plugins and managed hosts store finished copies of pages and serve those, which makes a cached WordPress site behave much like a static one for anonymous visitors, until a cache miss or a logged-in request.

Sohail Hussain

Founder, MSH Technologies

Sohail has designed and built websites, web apps and AI products for over 12 years, for clients from Singapore-based industrial groups to early-stage SaaS startups. He writes about what actually worked.

Keep reading

Related guides.

All posts

Your next move

Like what you see? Tell us about it.

A process that takes too long, a website that undersells you, or an idea ready to take shape. Tell us where you are and we will suggest a useful next step.

India · Working with clients worldwide

Sohail, Founder, replies within 1 working day (Mon–Sat, IST). Free and no obligation.