Code Monkey home page Code Monkey logo

next-shared-cache's Introduction

@neshca/cache-handler

npm package Dependencies License

Welcome to @neshca/cache-handler, a specialized ISR/Data cache API crafted for Next.js applications. This library is designed to simplify the complex task of configuring shared cache strategies in distributed environments, such as those involving multiple and independent instances of the same application. It offers a flexible and user-friendly approach to integrating custom cache solutions and hand-crafted, pre-configured cache strategies for Redis.

Next.js Routers support

  • Full support for the Pages and the App Router.

The importance of shared cache in distributed environments

Next.js applications are often deployed in a self-hosted distributed environment, where multiple instances of the same application are running simultaneously. In such cases, the default Next.js cache is not shared between instances, causing the data to diverge between independent instances because load balancers route requests to a different instance every time. Another significant issue with the default cache setup is on-demand revalidation; it requires manual revalidation across all application replicas.

@neshca/cache-handler elegantly addresses these challenges by offering:

  • A straightforward API complemented by meticulously crafted Handlers.
  • Comprehensive customization options.
  • Simplified on-demand revalidation, akin to managing a single application instance.
  • TTL by default to keep cache storage clean and space-efficient.
  • One configuration for both Routes.
  • neshCache application-side function.

Kickstarting Your Custom Cache Solution

Begin enhancing your application's caching system with our Installation and the First Steps. This section provides all the necessary information on installation, basic configuration, and practical examples for quick and efficient integration.

Examples and Practical Implementations

Discover the versatility of @neshca/cache-handler in our Examples Section, where real-world scenarios are illustrated.

Learn how to build your own Handler by reading this guide.

Contribute

Developing and contributing to this monorepo

Or become a Backer

Become a Backer

License

All projects in this monorepo are licensed under the MIT License.

next-shared-cache's People

Contributors

dependabot[bot] avatar better-salmon avatar github-actions[bot] avatar maktail avatar mitrvlr avatar zecka avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.