Websites & hosting · Term

Dynamic website

A dynamic website is a site whose pages are assembled on request, usually by code running on the server that pulls content from a database, so each page can change with the visitor, the time or new data.

Dynamic is about how pages are built, not about movement on the screen. A page with no animation at all is dynamic if the server builds it for each visit, and a page full of animation can be static. Most CMS-driven sites, online shops, booking systems and anything with logins are dynamic.

There is also dynamic content in the browser: JavaScript that loads data after the page arrives, as in a live search box or a map. Many modern sites mix both approaches, serving static pages that call small dynamic services where needed.

How it works

When a visitor requests a page, the web server passes the request to an application written in a language such as PHP, JavaScript or Python. The application reads the request, checks who the visitor is from their cookies, queries the database for content, products or bookings, and fills a template with the results. The finished HTML is sent back, and the process repeats for the next visitor.

That work costs time and server resources on every request, which is why dynamic sites rely on caching. A page cache stores a finished copy of pages that are the same for everyone, so most visits skip the database entirely. Pages that are genuinely personal, such as a basket, an account area or a booking form, are excluded from that cache and built fresh each time.

More moving parts also means more to protect. The application, its plugins, the database and the login system all need updates and secure configuration, and forms must be guarded against spam and malicious input. Login pages need limits on repeated attempts, and every input that reaches the database must be handled safely so it cannot be used to run commands, a class of attack known as SQL injection.

Example

A travel agency's site lists tours with live seat availability. When someone opens a tour page, the server checks the database for remaining seats and current prices and shows them. When a customer books, the system hands the payment to the payment provider, records the confirmed payment, reduces the seat count and emails a confirmation. A static site could not show those numbers without a dynamic service behind it.

The agency keeps the brochure pages, such as destination guides and the about page, cached for everyone, while tour availability and checkout bypass the cache. After a tour sells out, the cached tour listing is cleared so visitors never see seats that no longer exist. Because checkout runs on the same server, the agency also asks its host to confirm the plan can handle the busiest booking day of the year, when a new season's tours are released.

Why it matters for your business

Dynamic sites are what make online sales, bookings, member areas and staff-edited content possible, so for many businesses they are the only realistic option. They cost more to host and maintain than static sites and present a larger attack surface, and a poorly cached dynamic site can be slow under load. If the site is mainly information that changes occasionally, a static approach may serve better; if customers transact or log in, budget for the hosting, updates and monitoring a dynamic site needs.

Common mistakes

  • Leaving every page uncached, so each visit queries the database and the site slows at busy times.
  • Caching personal pages such as baskets or accounts, which can show one customer's data to another.
  • Skipping software updates because the site still works, leaving known vulnerabilities open.
  • Building custom dynamic features for content that changes once a year.

Questions people ask

What is the difference between a static and a dynamic website?

A static site sends pre-built files that are the same for every visitor. A dynamic site builds pages on request using code and a database, so content can change per visitor or in real time. Static is faster and simpler; dynamic supports logins, shops and live data.

Is a dynamic website slower?

It can be, because each page needs server work. With good caching, most pages are served from a stored copy and load as fast as static pages. Slowness usually comes from heavy plugins, uncached pages or underpowered hosting rather than from being dynamic.

Is WordPress a dynamic website?

Yes, by default. WordPress builds each page with PHP and a MySQL or MariaDB database when it is requested, though caching plugins and hosts usually serve stored copies to most visitors. It can also be used headless, feeding a static front end through its API.

Related terms

Have something worth building right?