A redirect that appears “stuck” is often being served from a browser, CDN, proxy, or server cache rather than from the rule you just changed. This guide explains how cached 301, 302, and 308 responses behave, how to test the active response path, and how to clear or control caching without disrupting a migration.
Overview
Redirect caching is the practice of storing an HTTP redirect response so that a later request can be answered without repeating the full trip to the origin server. Caching can improve response time, but it can also make a corrected URL redirect appear not to work.
There are several possible cache layers:
- Browser cache: the user’s browser may remember a previous redirect.
- CDN cache: an edge location may have stored the response close to the visitor.
- Forward proxy: a network proxy may reuse a cached response.
- Origin or application cache: the web server, framework, WordPress plugin, or hosting platform may cache redirect logic or its output.
A 301 redirect indicates a permanent move, while a 302 redirect is generally used for a temporary change. A 308 redirect is also permanent and preserves the request method in situations where that distinction matters. The status code alone does not tell you how long a response will be cached. Cache behaviour is influenced by response headers, platform settings, intermediary rules, and the client.
For broader implementation guidance, see Apache, Nginx, Cloudflare, and WordPress redirects. If your issue involves several redirects in sequence rather than an old cached response, use the guide to finding and fixing redirect chains and loops.
Checklist by scenario
A redirect changed, but your browser still follows the old destination
- Test the URL in a private browsing window or a different browser.
- Test from a separate network where practical, such as a mobile connection.
- Inspect the redirect with developer tools or a redirect checker.
- Compare the result with a command-line request to reduce browser-specific variables.
- Only clear the browser cache after confirming that the origin now returns the intended response.
Clearing a browser cache does not remove a response held by a CDN, proxy, or hosting platform. If the result is unchanged across browsers and networks, investigate an upstream cache or the redirect rule itself.
A CDN continues to return an old 301 or 308 response
- Check the CDN’s cache status and identify the hostname, path, and query-string rules involved.
- Purge the exact URL first, including relevant variants such as HTTP, HTTPS, www, non-www, and trailing-slash forms.
- Review whether a wildcard purge is necessary and whether it could remove useful cached content.
- Request the URL again from more than one location if the CDN uses distributed edge caches.
- Confirm that the origin rule is correct before allowing the response to be cached again.
Some platforms apply separate caching rules to redirects and page content. The control may be labelled cache purge, URL purge, edge cache, redirect cache, or a similar term, so check the platform’s current documentation and configuration.
A migration is being tested before launch
- Use a temporary test hostname or a controlled test path where possible.
- Avoid testing an unconfirmed rule with a long-lived permanent redirect.
- Use a 302 when the destination is genuinely temporary and the change is still being evaluated.
- Set an explicit, short cache lifetime for test responses if the platform permits it.
- Test representative old URLs, destination URLs, query strings, protocol variants, and hostnames.
- Before launch, replace temporary rules with the intended permanent rules and review cache settings.
Do not treat a 302 as a way to make an accidental permanent move harmless indefinitely. Select the status code based on the real purpose of the change. The guide to 301 versus 302 redirects provides a separate decision framework.
A command-line test shows a different result from a browser
Use a request that does not automatically follow the redirect:
curl -I https://example.co.uk/old-page
The -I option requests headers so you can inspect the status and the Location header. To follow the chain and see each response, use:
curl -IL https://example.co.uk/old-page
Look for repeated locations, unexpected host changes, and different results between HTTP and HTTPS. Add a user-agent or other request header only when you have a specific reason, because changing the request can activate different server or CDN rules.
What to double-check
| Header or signal | What it helps you assess | What to check |
|---|---|---|
HTTP/1.1 301, 302, or 308 | The redirect type returned for this request | Whether it matches the purpose of the change |
Location | The next URL in the redirect path | Whether it is correct, absolute or relative as expected, and free from a loop |
Cache-Control | Cache instructions for clients and intermediaries | max-age, no-cache, no-store, or other directives set by your stack |
Expires | An older-style expiry signal | Whether it conflicts with your intended testing window |
Age | Indication that a shared cache may have stored the response | Whether the value changes after a purge or fresh request |
| CDN cache headers | Provider-specific cache status | Whether the response was a hit, miss, bypass, or revalidation |
Headers are evidence, not a complete diagnosis. A missing header does not prove that no layer has cached the response, and a cache-related header may be added or changed by an intermediary. Record the complete response, request time, URL, hostname, protocol, and test location.
Also check for an implementation conflict. A redirect may be defined in Apache configuration, Nginx configuration, a CDN rule, a hosting control panel, or a WordPress plugin. Two rules can produce an apparent cache problem when the real issue is rule order or a second redirect layer. Keep one authoritative redirect mapping and document where it is applied.
Common mistakes
- Testing only in one browser: this can confuse local browser state with the server’s current response.
- Purging the wrong URL: HTTP and HTTPS, www and non-www, and path variants may be cached separately.
- Following redirects without inspecting each hop: this hides a redirect chain or loop.
- Changing several systems at once: changing DNS, CDN rules, origin rules, and application settings together makes the cause harder to isolate.
- Using long-lived caching during a test: a permanent response can remain difficult to replace in some clients and intermediaries.
- Assuming a purge fixes the rule: a purge only removes stored output; it does not correct an incorrect origin configuration.
- Ignoring query strings: CDN cache keys may treat URL parameters differently, which can make one version appear fixed while another remains old.
- Creating an open redirect while troubleshooting: never accept an arbitrary user-supplied destination without validation. See the open redirect checklist before deploying forwarding logic.
When to revisit
Return to this checklist before a website migration, after changing an Apache or Nginx rule, when modifying Cloudflare or another CDN, and whenever a hosting platform changes its cache controls. It is also useful before seasonal campaign launches, when short links or QR code destinations are updated, and after changing HTTP-to-HTTPS or www-to-non-www forwarding.
For a migration, combine cache testing with a documented redirect map. Review the old URL, intended destination, status code, canonical target, cache policy, and test result for each important route. The website migration redirect map template can help organise that audit.
When a redirect refuses to update, follow this order: confirm the origin response, inspect every redirect hop, test outside the browser, identify the caching layer, purge the narrowest relevant cache, and test again from more than one environment. Only then increase or restore the desired cache lifetime. This approach keeps troubleshooting reversible and reduces the risk of turning a temporary testing issue into a wider SEO redirect problem.