Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@neshca/cache-handler

Package Overview
Dependencies
Maintainers
1
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@neshca/cache-handler

Next.js self-hosting simplified.

  • 1.9.0
  • latest
  • next14
  • next13.5
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@neshca/cache-handler

Flexible API for replacing the default Next.js cache, enabling custom caching solutions for multi-instance self-hosted deployments.

npm package Dependencies License

Latest Release

🎉 Version 1.9.0 has been released! It changes the default estimateExpireAge function to perform the calculation as (staleAge) => staleAge * 1.5 to better align with the default Next.js cache behavior.

This is the final release leading up to version 2.0.0. The upcoming version 2 will bring significant changes and will no longer support Next.js versions 13 and 14. While version 1 will still receive ongoing maintenance, it won't get any new features.

Check out the changelog for more details.

Table of Contents

  1. Overview
  2. Getting Started
  3. Examples
  4. Requirements
  5. Documentation
  6. Contributing
  7. License

Overview

Welcome to @neshca/cache-handler (pronounced /ˈnæʃkʌ/), a specialized ISR/Data cache API crafted for Next.js applications. This library simplifies configuring shared cache strategies in distributed environments, such as multiple, independent application instances. It offers a flexible and easy-to-integrate solution for custom cache strategies, especially for Redis.

Features

  • Shared Cache for Distributed Environments: Perfect for self-hosted deployments with multiple application instances.
  • Easy Customization: Provides a straightforward API with pre-configured Handlers.
  • On-Demand Revalidation: Simplifies revalidation across all application replicas.
  • TTL Management: Automatic cache cleanup to keep storage space efficient.
  • Support for Next.js Routers: Full support and one setup for the Pages and the App Router.
  • neshCache Function: Utilize the neshCache function to replace unstable_cache for more control over caching.
  • neshClassicCache Function: Use the CacheHandler in the Pages Router to cache the result of expensive operations in the getServerSideProps and API routes.
  • Pre-populate the Cache with Initial Data: Automatically pre-populate the cache with the initial data when the application starts using the instrumentation hook ↗.

Getting Started

Enhance your application's caching with our Installation and First Steps Guide. This guide covers installation, basic configuration, and practical examples for quick integration.

Examples

Explore the versatility of @neshca/cache-handler in our Examples Section with real-world scenarios. Learn how to build a custom Handler by following this guide.

Requirements

  • Next.js: 13.5.1 or newer (below 15.0.0).
  • Node.js: 18.17.0 or newer.

Documentation

For detailed documentation, visit our Documentation Page.

Contributing

We welcome contributions! Check out our Contributing Guide for more information.

License

This project is licensed under the MIT License.

Keywords

FAQs

Package last updated on 26 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc