After a CMS migration, check six things in order: page cache (purge it completely), object cache (flush it), the CDN cache and its cache rules, browser cache headers on static assets, any cached database transients left by the old setup, and whether caching plugins or modules are double-caching each other. Most post-migration "the site looks broken" reports are stale cache, not broken code.
A content management system (CMS) migration changes the HTML, the asset URLs, and often the server. Caches layered on top of that do not know anything changed. Until each layer is cleared and reconfigured, visitors can be served a mix of old markup and new assets — which is exactly how a working site renders wrong.
Official resources:
- Follow Google's site move with URL changes checklist — Google's own steps for redirect mapping, testing and monitoring traffic after a migration, so cached or stale URLs are caught before rankings drop.
- Check your Cache-Control directives against the MDN header reference — Verify what each max-age, no-store and private directive actually does before setting browser and CDN cache lifetimes on the new CMS.
Table of Contents
- Purge every cache layer before you diagnose anything else
- Which settings actually need reconfiguring, not just clearing
- Browser cache headers and the long-TTL trap
- Stale data inside the CMS itself
- How to verify the caches are behaving
- Frequently Asked Questions
Purge every cache layer before you diagnose anything else
A typical site has four or five caching layers stacked between the database and the browser. In rough order from the server outward: an object cache (Redis or Memcached), a page cache (a plugin like WP Super Cache or LiteSpeed Cache, or Drupal's internal page cache), a server-level cache (Varnish, Nginx FastCGI cache, LiteSpeed), a CDN edge cache (Cloudflare, Fastly, BunnyCDN), and the visitor's browser cache. Purge them from the inside out.
Clearing the CDN first is wasted work if the origin still serves stale HTML — the CDN simply re-fetches the old page and caches it again. Flush the object cache, then the page cache, then the server cache, then the CDN, and only then test in a private window. Do this before you start editing templates or chasing CSS bugs. A surprising share of post-migration emergencies resolve at this step, and debugging against a cached response wastes hours and sometimes produces "fixes" for problems that were never real.
Which settings actually need reconfiguring, not just clearing
Clearing a cache is temporary; a misconfigured rule keeps breaking things. These are the settings most likely to be wrong after a move: Drupal adds its own wrinkle: cache tags and contexts.
A migrated custom block or view with missing cache metadata can serve the wrong content per user or fail to invalidate when the underlying entity changes. Rebuilding the cache with `drush cr` clears symptoms but not an incorrect `#cache` definition.
- **Cache exclusions.** Cart, checkout, login, account, and search pages must not be page-cached. Exclusion rules are path-based, so a new URL structure silently invalidates them.
- **Logged-in user caching.** Serving cached pages to logged-in users can leak one person's session view to another. Verify this is off unless the cache is explicitly session-aware.
- **Cookie and query-string handling.** If the CDN ignores a cookie your new CMS relies on, it will serve one user's page to everyone. If it treats every UTM parameter as a unique URL, your hit rate collapses.
- **Asset optimization.** Minification, concatenation, and critical-CSS features cache generated files. Those files reference the old theme's classes and paths and must be regenerated.
- **Cache lifetime (TTL).** A long TTL set for a stable old site makes the new one slow to update. Shorten it for the first week, then raise it.
Browser cache headers and the long-TTL trap
Browser caching is controlled by response headers — chiefly `Cache-Control` with its `max-age`, and `ETag` or `Last-Modified`. These live in server config, the CDN, or a caching plugin, and migrations frequently reset them to a default that is either far too short or dangerously long. The problem case is HTML.
If your old server sent `Cache-Control: max-age=31536000` (one year) on HTML documents, returning visitors hold a copy of the old page and you cannot purge their browsers. HTML should carry a short max-age or `no-cache` with revalidation; long lifetimes belong to versioned static assets. If the old site served long-lived HTML, assume some returning visitors are stuck. Changing the URL — or the asset version strings — is the only reliable way to reach them.
- Check headers with your browser's network panel or `curl -I https://example.com`.
- Confirm HTML has a short or revalidating `Cache-Control`.
- Confirm CSS, JS, fonts, and images have long `max-age` plus `immutable`, and that their filenames or query strings change when the file changes.
- Watch for `Vary` headers that are missing (breaks correct variant delivery) or too broad, such as `Vary: User-Agent`, which fragments the cache badly.
Stale data inside the CMS itself
Not every cache sits in front of the site. WordPress stores transients and cached option values in the database; Drupal keeps `cache_*` tables and a container and routing cache. A migration can carry these across intact, so the new install starts up believing things about the old environment. The symptoms are distinctive: broken links to the old domain, menus that will not update, a stuck sitemap, plugin settings that revert, or 404s on pages that clearly exist.
A stale routing or rewrite cache is the usual cause of the last one. Flushing permalinks in WordPress (visiting the Permalinks settings screen re-saves the rewrite rules) and rebuilding the Drupal cache both address that class of problem. Also check whether the migration ran a search-and-replace across serialized data. Cached objects stored as serialized PHP break when a naive string replacement changes a value's length without updating its length prefix. Tools built for the job, such as WP-CLI's `search-replace`, handle serialization correctly; a raw SQL `REPLACE()` does not.
How to verify the caches are behaving
Test from a clean state rather than your own browser, which holds every cached version of the site you have looked at today. Keep caching off, or set to a very short TTL, for roughly the first 24 to 48 hours after the DNS cutover. You will be making changes constantly, and a cache that hides them turns every fix into a guess about whether it worked.
- Open the site in a private window, or run `curl -I` to read raw headers.
- Look for cache status headers: `x-cache`, `cf-cache-status`, `x-litespeed-cache`, or `age`. A `HIT` on a page that should never be cached is a configuration bug.
- Load the site logged in and logged out, and confirm you get different HTML.
- Submit a form, add to cart, and log in. These are where bad exclusion rules show up first.
- Edit a post and time how long the change takes to appear publicly. That interval is your effective TTL.
Frequently Asked Questions
Should I turn caching off entirely during a migration?
Turn page and CDN caching off, or drop the TTL to a minute or two, from the cutover until the site is stable. Leave object caching on if the new environment is configured for it — it reduces database load without hiding your edits.
Why does the site look correct for me but broken for other people?
You have likely purged caches and reloaded while others are being served an edge-cached or browser-cached copy. Confirm with a private window, a different network, and the CDN's cache status header rather than your own browser.
Do I need to purge the CDN if I changed hosts but kept the same domain?
Yes. The CDN caches by URL, not by origin IP, so identical URLs continue serving the old origin's responses until they expire or you purge them. Also update any origin IP or hostname the CDN has pinned.
My search pages and cart are being cached. What broke?
Cache exclusion rules reference specific paths, and migrations often change them — `/?s=` to a pretty search URL, or a different cart slug. Re-enter the exclusions using the new site's actual URLs and retest each one.




