Many HTTP APIs have a batch endpoint. This allows multiple values to be requested with a single HTTP call.
This doesn't work well with ZIO-cache right now, as there is no way to look up multiple values at once.
HTTP endpoints are prime targets for caching, since network overhead is usually significant. So I think support for this use case would be a great addition to ZIO-cache.
I'm not sure what the best interface for this would be, but ideally, it would:
- Use cached values for keys already present in the cache;
- Call the user-defined batch function with the remaining keys (if any);
- Add new entries to the cache;
- Enforce at the type level that the user-defined batch function returns a value for every key.
Many HTTP APIs have a batch endpoint. This allows multiple values to be requested with a single HTTP call.
This doesn't work well with ZIO-cache right now, as there is no way to look up multiple values at once.
HTTP endpoints are prime targets for caching, since network overhead is usually significant. So I think support for this use case would be a great addition to ZIO-cache.
I'm not sure what the best interface for this would be, but ideally, it would: