cache-adapter
Introduction

@nimpl/cache-adapter

(Former next-impl-cache-adapter)

An adapter that allows you to use any cache handler on the client and server side and switch between them. Adds support for running next.js applications in multiple instances.

Advantages

  • Shared cache between different instances (replicas, copies) of the application.
  • Three caching options: local, remote and isomorphic.
  • Same cacheHandler on the client and on the created server.
  • Caching without server restart.
  • Clearing of outdated cache.

Installation

Using npm:

npm i @nimpl/cache-adapter

How it works

For a common cache between instances (replicas, copies) - the cache should be separate from each application instance. This solution does it by creating a separate service.

The application can then work with the cache through this remote server. The server acts as a cacheHandler and can be used from the running application and/or from the build mode.

The server does not need to be restarted each time. And outdated data will be deleted automatically when launching a new version of the application.

Examples

Base example with @nimpl/cache-in-memory. See example.

Additional

Please consider giving a star if you like it, it shows that the package is useful and helps continue work on this and other packages.

Create tasks with wishes, ideas, difficulties, etc. All of them will definitely be considered and thought over.