The right way to handle changing configuration in ASP.NET Core middleware

You&rsquo;ve got a middleware. It reads a comma-separated list of allowed hosts from configuration. Or maybe it loads a dictionary of route mappings, or parses a set of feature flags into a lookup table. The config value can change at runtime and you need to pre-process it into something your middleware can actually use on every request. How hard can it be? 🤷