Skip to content
On this page

Memory provider

The memory provider allow you to store cached content in memory. It use a simple key-value store with LRU algorithm provided by the default provider of node-cache-manager module which uses lru-node.

Installation

INFO

This provider is already installed with the plugin.

Configuration

js
// file: /config/plugins.js

module.exports = ({ env }) => ({
  'rest-cache': {
    config: {
      provider: {
        name: 'memory',
        getTimeout: 500,
        options: {
          // The maximum size of the cache
          max: 32767,
          // Update to the current time whenever it is retrieved from cache, causing it to not expire
          updateAgeOnGet: false,
          // ...
        },
      },
      strategy: {
        // ...
      },
    },
  },
});

TIP

View full options available on lru-cache documentation.