The built-in vcl_deliver
subroutine is executed before the first byte of the response is emitted to the client. Deliver happens on every response individually, including responses delivered from cache and those received from a backend, making it an ideal place to add debugging information or user-specific session data that cannot be shared with other users.
This is a companion discussion topic for the original entry at https://developer.fastly.com/reference/vcl/subroutines/deliver