How can I clear 301 redirects from Cloudflare's cache?

Hi there! I’m using Amazon S3 buckets with website configurations to redirect from one subdomain to another. I’d like to proxy these using Cloudflare so that users can attempt to connect with SSL and be properly redirected.

When I first set up these buckets, I had been using the “redirect all requests” option, which serves a 301 response. It appears that these redirects are now permanently cached in Cloudflare, because even though I’ve changed the redirect destination for some of these, Cloudflare still serves the old redirect. For example, summerlarpin.concentral.net serves a redirect to summerlarpin2022.concentral.net, even though the actual S3 website URL (summerlarpin.concentral.net.s3-website-us-east-1.amazonaws.com) serves a redirect to summerlarpin2024.

These subdomains are set up as CNAME records with proxying turned on, pointed at the S3 website URLs of the underlying buckets. I’ve tried purging the cache via the Cloudflare web UI (both “purge everything” and “by URL” options), and I’ve changed the S3 configuration so that it’s now serving 302 redirects, but nothing seems to change the redirect destination Cloudflare serves. Anyone have any ideas of how to get Cloudflare to recheck the origin?

It seems like the redirection was not due to cache, but you may have explicitly configured some kind of redirection rules in Cloudflare previously (could be page rules, redirect rules).

If the redirection is due to cache, we should see the CF-Cache-Status header in the response, but this is not the case.

3 Likes

Whoops! Thanks so much @erictung, you’re totally right. I configured those years ago and forgot about them :facepalm:

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.