Web / Caddy Server Interview questions
How do you configure Caddy for zero-downtime configuration reloads at scale?
A single reload already avoids downtime through Caddy's admin API; scaling that reliably across a fleet needs a bit more process discipline on top.
Locally, caddy reload (or a POST to /load) works by building the entire new configuration in memory first, then atomically swapping it in for the old one; listeners that are unchanged between the old and new config are kept open rather than closed and reopened, so in-flight connections on those ports are not dropped. At fleet scale, the practice is: validate the config offline first with caddy validate --config Caddyfile, roll the reload out node by node (or via a deployment tool) rather than all at once, and watch each node's response and logs before moving to the next, so a bad config only affects one node at a time instead of the whole fleet.
More Related questions...