And if latency is important, you need that origin to be close to the user.
The front end is the least latency critical component in a lot of stacks, because the user downloads it once and can cache it on their machine, whereas every single action they make using that UI is subject to the latency of going to your back end