An example of how to implement a server that caches data
Goals:
- The cache has a TTL
- Each request must be handled as fast as possible, while returning a fully valid response
- Consider the updateCache function as expensive, so must avoid unnecessary calls.
- Don't block startup (assume the application does other stuff and that must be up asap)
- Be correct (no data races)