How does redirect caching work?

I’ve heard “10k redirects can add hundreds of ms”. All cases will differ, so there is no exact metric.

As I said, we do some caching, and if you have a redirect like:

/blog/* https://wpengine.com/:splat 301!

…that gets cached and requests to /blog/* will be quick - but that doesn’t affect every other asset like logo.png. It also doesn’t fix the problem to “just cache 301s”, for instance:

  • we have to check for files that AREN’T covered by a redirect, over and over again. We can’t necessarily cache all your RULES at the CDN edge, when you have this many rules! We want to use the cache for FILES, not rules, so the cache size for files is much larger, and 25k redirects is way more than we want people to have, so we aren’t optimizing for that use case.
  • Also, we have dozens of CDN nodes and EACH has its own, independent cache, so one node might get everything cached - and the other nodes don’t.

If you want to send an x-nf-request-id for a slow request that you’d like me to look into, I’ll be happy to advise if there are any easy wins - sometimes, you just have DNS misconfigured, and it isn’t even about redirects! Talking about this in the abstract isn’t going to help further, I think :slight_smile:

this article describes what I’m looking for:

If you proxy through cloudflare to Netlify, won’t be able to help much further though. Here’s why:

Please make any x-nf-request-id you send is from a direct-to-netlify connection :slight_smile:

1 Like