Skip to content

Feature Request: Basic caching support #35

@randomiser

Description

@randomiser

Hi Ilya,

It would be really useful to have a simple mechanism to support caching. For example for SQL data that rarely changes but needs to be loaded often within the graph.

Thinking the r.model could be changed to support this with additional methods something like:

// return string | undefined
cacheKey = (context) => undefined;

// return existing data | query
preFetch = (context, query, cacheKey) => query;

// callback to potentially store in cache
postFetch(context, data, cacheKey) {}

With changes to the r.graph to support the above.

Keen to hear any thoughts.

Kind regards,
Matt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions