Caddy 2 HTTP handlers come in two flavors: middleware and responders.
- Middleware are in the middle of a request chain; i.e. they have a
next
handler to invoke. - Responders are content origins, at the end of a request chain; i.e. there is no
next
handler. Any handlers defined after it would not be invoked.
Caveat: Sometimes a handler's role is ambiguous. For example, a caching handler would be middleware on a cache miss (it needs to invoke the upstream handlers for a response, then cache it), but on a cache hit it would be a responder, since no further handlers would be invoked (it would simply write the response).