A lightweight, eviction-conscious GraphQL caching library.

  • Support for LRU, LFU + MFU eviction
  • Constant time complexity across all operations

Start by installing our package as a dependency to your project.

npm install qlache

Require QLache into your project.

const QLache = require('qlache');

Invoke QLache to create an instance of the cache.

const cache = new QLache('example.api/gql', 'LRU', 100);

Instead of directly querying the API, utilize the query method as a middleware function in your server.

cache.query