github.com/moxar/xload (go): Package xload provides request caching and buffering tools.  Request caching and buffering is a common requirement in backend development. As an example, GraphQL performance enhances a lot when the incomming request uses those two mechanism.  https://github.com/vektah/dataloaden proposes an implementation that generates code to handle both issues. However, the implementation does not distinguises caching and buffering. Some requests cannot be cached but can be buffered, and vice versa. This package (aims to) provide both features in an independant, yet combinable way.  With two SQL queries A and B  Benefits of caching and buffering would be:  Finaly, the initialization of the buffer or cache must be cheap. They are meant to be scoped to a unique job such as a http request.  The following definitions must be evaluated in regard of this package's context. Note that the request is agnostic of the backend (REST, HTTP, SQL, Redis...).  Buffering consists in aggregating similar requests emitted during a short period of time, to send a unique, bigger request.  Caching consists in saving, in memory, the response of a request for a short period of time. This response must be accessible with a unique identification that is tied to the request.
Keywords: buffer|cache|go|request