How many is too many redir rules?

1. The problem I’m having:

This is more of a question than an actual problem. I’m looking at using caddy to replace part of a CMS feature. The CMS generate urls based on the content title and when that title change, the URLs for the content changes, to not loose bookmarks or SEO there is an redirect automatically created from the old URL to the new URL. It is not exceptional to have 100k redirects rules for a single site.

If I were to move the 100k redirect to caddy, would it work efficiently? what would be the problems I could run into having 100k redir rules in my caddy config? What would slow down, would the server work at all? I’m currently on Apache and that many redirects is just not possible to handle at the Apache level.

I do not have a running Caddy server to try things out or dig into the limits of what can be done so I’m mainly seeking advice on “is this reasonable at all for caddy?” or should I just forget it and keep the application level implementation?

Thank you!

2. Error messages and/or full log output:

none see above.

3. Caddy version:

theorical question, see above

4. How I installed and ran Caddy:

theorical question, see above

a. System environment:

theorical question, see above

b. Command:

theorical question, see above

c. Service/unit/compose file:

theorical question, see above

d. My complete Caddy config:

example.com {
	redir /about-us /about
       # add 100k more lines like that
}

5. Links to relevant resources:

I’d have to look closer to be sure (but I’m mobile atm), but IIRC the redirects are just static_response handlers organized by routes with a path matcher.

Generally speaking, it might be O(n) in the worst case.

But those operations should be very fast, since if the first character doesn’t match, it’ll break and go to the next one.

I’d try out in a test env and see how it works for you! Might be just fine.