sfw/fix
308 medium

308 Permanent Redirect Stuck / Cached

A 308 is cached as hard as a 301 by browsers and CDNs, so a wrong one keeps serving long after you fix the origin.

What you see

HTTP/1.1 308 Permanent Redirect
Location: https://example.com/new-path

What’s actually happening

You changed or removed a redirect at the origin, but the old destination keeps loading. The browser jumps to the stale target before it even hits the network, and a CDN edge serves the cached 308 to everyone else. Because 308 is permanent by definition, Chrome and Safari cache it indefinitely — clearing your own cache fixes your machine while every other visitor stays stuck.

Common causes

  • A 308 was issued by mistake (framework default, or a copy-paste of a redirect block) and browsers cached it permanently.
  • Cloudflare / Fastly / CloudFront cached the 308 response and is serving it from the edge until the TTL expires or you purge.
  • The origin still returns the 308 — you edited the wrong vhost, a stale container is still running, or the rule sits in a config that didn't reload.
  • A service worker cached the redirect and replays it offline-first, independent of the network.
  • next.config.js / nginx permanent:true flipped a 307 to a 308 and that got cached across the CDN.

How to fix it

  1. Confirm what the origin sends nowBypass the CDN and curl the origin directly: curl -sI --resolve example.com:443:ORIGIN_IP https://example.com/path. If you still see 308 here, the origin isn't fixed — wrong vhost, unreloaded config, or a stale container. Fix that before touching cache.
  2. Purge the CDNOnce the origin is right, purge the cached redirect. Cloudflare: Caching > Purge by URL (or Purge Everything). Fastly: purge the URL/surrogate key. CloudFront: create an invalidation for the path. The edge will keep serving the old 308 until you do.
  3. Bust the browser cache for usersYou can't reach into visitors' caches. If it's urgent, change the URL slightly or serve the new target from a path that was never 308'd. For your own testing, use a Private window or DevTools > Network > Disable cache, since your local cache holds the 308 hard.
  4. Kill a stale service workerIf a service worker is replaying the redirect, bump the SW version or unregister it. DevTools > Application > Service Workers > Unregister to confirm that's the culprit.
  5. Use the right code going forwardIf the move is temporary or you might revert, use 307 (temporary, method-preserving) so it isn't cached permanently. Reserve 308 for moves you're certain are permanent.

Stop it recurring

Don't issue 308 unless the move is truly permanent — use 307 for anything you might undo, since both are cached aggressively.

Related errors