Is there a way to make cloudflare follow redirects?

My backend returns a redirect to another URL and it would be much better (especially in terms of caching) when Cloudflare could just follow the redirect and then return the response instead of just returning the redirect response. Is there a way to accomplish this? Maybe with a special header?
2 Replies
Chaika
Chaika16mo ago
A bit late, but no there's nothing like that. It doesn't really make sense for a proxy to do that, and I believe by spec 3xx responses are meant to be handled by the client. There would be a lot of other security/etc issues with it. If you really need something like that, I suppose you could run a worker over it on a route, and have the worker fetch the origin's response, get out the Location header, and fetch that, and then return the result. You could have the worker cache as well, but the worker would still be invocated for every request
Martin 0x522E
Martin 0x522EOP16mo ago
I see. Thanks anyway
Want results from more Discord servers?
Add your server