301 Redirect Caching: How to Control, Diagnose, and Clear Stale Redirects
301 redirectsHTTP cachingCDNweb performancesite migrationredirect troubleshooting

301 Redirect Caching: How to Control, Diagnose, and Clear Stale Redirects

PPortal Redirect Editorial Team
2026-11-10
6 min read

Learn why old redirects persist and use a practical checklist to diagnose browser, CDN, proxy, and cache-header issues safely.

A stale redirect can make a corrected URL appear broken long after the server rule has changed. This guide explains how browser caching, CDN edge caching, proxy behavior, cache headers, and redirect status codes interact, then provides a repeatable checklist for diagnosing, clearing, and safely validating an old redirect.

Overview

When someone requests a URL, the response may pass through several caching layers before reaching the browser: the origin server, a reverse proxy, a CDN, a corporate network, and the browser itself. Any of these layers may retain a redirect response. As a result, changing a redirect rule does not always change what every visitor sees immediately.

A 301 redirect communicates that a URL has moved permanently. A 302 generally represents a temporary move, while a 307 preserves the request method when redirecting. The status code describes the intended move; caching headers help determine how long an intermediary may reuse the response. These are related but separate controls.

For example, a redirect response might include:

HTTP/1.1 301 Moved Permanently
Location: https://www.example.com/new-page
Cache-Control: max-age=3600, public
Expires: Wed, 05 Nov 2026 14:00:00 GMT

Cache-Control is usually the clearest modern control for shared and browser caches. Expires is an older date-based mechanism that may still appear in infrastructure configurations. Neither header guarantees that every layer will retain or discard a response in exactly the same way, so diagnosis should begin with actual response headers and the layer serving them.

Before changing a live rule, record the intended source URL, destination URL, status code, query-string behavior, and current cache settings. For larger changes, keep a redirect map and use a redirect audit checklist to document the expected result.

Checklist by scenario

When a browser keeps using an old destination

  1. Test the URL in a private browsing window or a separate browser profile.
  2. Compare the result on another device or network. If only one browser is affected, the browser cache, service worker, or local extension may be involved.
  3. Inspect the response in browser developer tools. Check the status code, Location header, cache headers, and whether the response came from memory or disk cache.
  4. Use a cache-busting query string for diagnosis, such as ?redirect-test=1. This is a test technique, not a replacement for correcting the underlying cache policy.
  5. After confirming the server response is correct, clear site data only for the affected domain if a local browser cache is responsible.

When a CDN or proxy serves the old redirect

  1. Request the URL with a command-line tool or a redirect checker from more than one location. Save the complete headers, not just the final destination.
  2. Check whether the response includes cache indicators such as Age, Via, X-Cache, or a vendor-specific cache-status header. These names vary by infrastructure.
  3. Open the CDN or proxy control panel and purge the exact URL. If the redirect rule was broadly cached, purge the relevant path, hostname, or cache zone according to the platform’s scope controls.
  4. Confirm that the purge completed before testing again. A purge request that is queued, limited to one region, or aimed at the wrong hostname will not resolve the issue.
  5. Recheck both the original URL and representative variants, including HTTP versus HTTPS, uppercase paths, trailing slashes, and query strings where those forms matter.

When correcting a site migration or domain redirect

  1. Temporarily favor a short, controlled cache lifetime while the destination is being validated. Avoid making a permanent redirect highly cacheable before the mapping is stable.
  2. Test a sample of important pages, not only the homepage. Include high-value backlinks, campaign URLs, QR code destinations, and URLs with tracking parameters.
  3. Confirm there is one direct hop to the intended final URL. A redirect chain can preserve confusion and add unnecessary requests.
  4. Once the mapping is verified, apply the intended long-term status code and caching policy deliberately.
  5. Monitor status codes, destinations, and traffic after launch. The redirect monitoring metrics guide can help structure a recurring report.

When you suspect a redirect loop

  1. Capture every hop and identify where the destination changes back to an earlier URL.
  2. Review HTTP-to-HTTPS, www-to-non-www, application-level, CMS, and CDN rules together. A loop often results from two layers enforcing different canonical versions.
  3. Temporarily bypass or narrow one rule at a time, then purge affected caches before retesting.
  4. Check origin logs as well as edge responses. A cache can hide whether the origin still returns the wrong rule.

What to double-check

ItemWhat it controlsWhat to verify
301, 302, or 307 statusThe meaning and handling of the URL moveThe code matches whether the move is permanent or temporary and, for 307, whether method preservation matters.
Cache-ControlFreshness and cache permissionsCheck max-age, s-maxage, public, private, no-cache, or no-store as applicable.
ExpiresA date-based freshness boundaryMake sure it does not conflict with the intended Cache-Control policy or an old server configuration.
CDN edge cacheResponses stored near visitorsConfirm cache key rules, purge scope, propagation status, and whether redirects are cached separately from page content.
Browser cacheResponses retained on an individual deviceCompare private browsing, another device, and a command-line request before assuming the server is wrong.
Origin ruleThe response generated by the application or web serverTest the origin where possible and verify that the CDN is not masking a corrected or incorrect response.

Use a redirect checker or command-line request that displays headers and follows redirects separately. A useful diagnostic pattern is:

curl -I https://example.com/old-page
curl -I -L https://example.com/old-page

The first command shows the initial response. The second follows the chain, making it easier to identify a stale destination, an unexpected intermediate URL, or a loop. For a deeper investigation, compare results from different locations and user agents, then review server and CDN logs. See redirect log analysis for a structured way to find repeated failures and wasted requests.

Common mistakes

  • Changing the destination without purging the old response: The origin may be correct while the edge still serves the previous 301.
  • Assuming a 301 is instantly forgotten: Permanent redirects can be retained by browsers, intermediaries, and crawlers according to their observations and cache controls.
  • Purging only one hostname: HTTP, HTTPS, www, non-www, and alternate domains may have separate cache entries and redirect rules.
  • Using a random query string as the fix: A cache-busting parameter can prove that a cached response is involved, but it does not repair links, search signals, or campaign URLs.
  • Testing only the final page: A successful destination can hide a chain, a lost query string, or an intermediate redirect with the wrong status code.
  • Rolling back without a map: Replacing a redirect rule under pressure can create loops or remove valid migration mappings. Keep the previous configuration and a timestamped change record.
  • Ignoring security: When changing forwarding rules, validate destinations and input handling. An uncontrolled redirect parameter can create an open redirect vulnerability; review the open redirect prevention guide before deploying dynamic rules.

When to revisit

Revisit this checklist before a domain launch, site migration, seasonal campaign, major URL restructuring, or change to CDN, proxy, hosting, or CMS infrastructure. It is also useful after correcting a redirect, publishing a new QR code destination, changing UTM tracking links, or receiving reports that visitors reach an outdated page.

During each review, record the date, test locations, response headers, redirect chain, cache purge scope, and final result. Start with a temporary or conservative cache lifetime while changes are being verified. Once the intended behavior is stable, increase the lifetime only when the permanence of the rule is clear.

Finally, add the corrected URLs to a recurring redirect audit. Check important backlinks, campaign links, and alternate hostname forms, and compare edge results with origin results. A short validation record turns the next stale redirect incident from guesswork into a repeatable technical process.

Related Topics

#301 redirects#HTTP caching#CDN#web performance#site migration#redirect troubleshooting
P

Portal Redirect Editorial Team

Technical SEO Editor

Senior editor and content strategist. Writing about technology, design, and the future of digital media. Follow along for deep dives into the industry's moving parts.