Hide and/or reduce cold start latency
imjasonh opened this issue · 0 comments
When loading gcping for the first time, some locations take 1s+ to return, because they weren't running before I hit them and Cloud Run had to start them up.
It would be nice if the initial cold start request was somehow signalled to the client and could be ignored or retried to get more accurate data. This wouldn't improve the actual experience of loading the page for the first time, but it might help reduce confusion seeing a 1s+ latency then having it immediately be replaced by a 100ms result the next time around.
I tried to do this in 279c799 but it doesn't seem to actually work. The X-First-Request
header isn't being seen by the client.
Though it's an easy solution to implement, the service shouldn't be running 24/7 with min-instances
(💰💰💰), so some cold start is inevitable.
The service is about as minimal as possible, so I don't think it's worth exploring how to reduce that much right now.