Tutorial · migration-hosting · Published 2026-08-16 · 4 min read

Cache and CDN after a migration

After a migration, flush WordPress, browser, DNS and CDN caches and verify the new origin is live instead of a stale copy.

Flat editorial illustration showing two data boxes crossing a bridge with a dotted orbit trail between them, one box accepting the transfer.
Illustration: this article at a glance.

A site migration ends at the DNS cutover, but the users may still be shown the old site for longer than the DNS change, because caches hold their own copies. The content delivery network, the hosting-level page cache, the CMS cache, the browser and even DNS resolvers each keep a version of the site, and none of them are invalidated just because the files or DNS changed. Clearing them in order is part of a correct migration, not an optional finish.

Editorial close-up illustration showing two data boxes crossing a bridge with a dotted orbit trail between them, one box accepting the transfer.
Illustration: a closer look at the technique described above.

What survives a move

Different caches answer to different triggers:

CacheWhat it holdsSurvives DNS change?
CMS cache (WordPress page cache, Redis)Rendered pagesYes, until flushed
CDN edge cacheCopied responsesYes, until TTL or purge
Host page cacheStatic full-page copiesYes, until cleared
Browser cacheCSS, images, pagesYes, per URL
DNS resolver cacheOld origin IPYes, until TTL

The last one is the migration-specific case: if an old copy was fetched from the previous origin, the caches still hold it. The older browser content article covers browser-side staleness, and the general CDN static assets guide explains edge caching.

Flush each layer in order

Do this after the DNS cutover has begun, from the systems you control down to the ones you only affect:

  1. CMS and host cache: flush the WordPress object and page cache (via the panel, a caching plugin, or the relevant tool) and clear the hosting-level full-page cache so the new origin renders fresh pages.
  2. CDN edge cache: purge the site at the CDN provider. On Cloudflare this is the purge operation covered in the purge cache article; the aim is the same on any edge, remove the copied responses for the site's URLs.
  3. Origin responses: confirm new response headers (cache control) point browsers at the new host and set an appropriate expiry, so stale copies do not linger.
  4. Browser: a private window bypasses your own browser cache and confirms the public response, rather than debugging a stale local copy.
  5. DNS: all that flush does is start fresh fetches from the current resolver or IP state; it does not force other resolvers. It is expected that some users see the old IP until the TTL passes.

The exact first click after cutover often shows the old site for the person who is testing, because their own browser or resolver still holds a copy. A private window against a freshly purged edge is the trustworthy test.

Verify the new origin

The final check is that the bytes come from the new host:

curl -sI https://example.com/

Compare the server or response header that identifies the host, and confirm a page or asset you changed as part of the migration is present. If the response still shows the old host after the DNS TTL and a CDN purge, either a resolver was slow or a cache was missed; walk the layers again rather than waiting.

Prevent the second round

When stale content persists

A visitor seeing the old site after a migration is almost never a reason to revert. Flush the layers in the order above, confirm the origin via curl, and let the TTL and browser timeouts clear the stragglers. If a specific page keeps showing old data, it is usually a single missing purge or a CMS cache that was not flushed, and the fix is that one layer.

Need a website built, fixed, optimised, migrated or replaced?

This technical resource is written by CSMBAC, a small design and development studio. If you would rather hand the problem to a professional, the website service page explains how we build enquiry-ready websites.

Explore website services