Traffic only has to leave the edge if you want to fetch from _your origins_ behind it, but any responses the Worker generates itself are local to that edge POP. Return a static response, inspect/validate a JWT, modify something on the way out of the cache: all close to the user.
Disclaimer: used to work at Cloudflare, still think it's a great product.
[1]: https://blog.cloudflare.com/eliminating-cold-starts-with-clo...