For a javascript library for caching data, the strongest matches are isaacs/node-lru-cache (This library provides robust in-memory caching with support for), ptarjan/node-cache (This library provides in-memory key-value storage with TTL expiration) and tannerlinsley/react-query (This library functions as a specialized cache manager for). mozilla/localforage and vercel/swr round out the shortlist. Each is ranked by relevance to your query, popularity and recent activity.
We curate open-source GitHub repositories matching “best javascript caching libraries”. Results are ranked by relevance to your query — pick filters below to narrow, or refine with AI.
node-lru-cache is a key-value store for Node.js that implements a memory-limited cache. It prevents memory exhaustion by capping the total number of items or total byte size, automatically evicting the least-recently-used items to maintain these limits. The project provides specialized caching patterns, including time-to-live durations to ensure data freshness and a stale-while-revalidate mechanism that serves expired content while asynchronously fetching updates in the background. It also includes diagnostic tools for monitoring cache hits, misses, and eviction metrics through operational st
This library provides robust in-memory caching with support for TTL expiration and LRU eviction policies, though it lacks built-in persistent storage capabilities.
Node-cache is a lightweight in-memory data storage module designed for Node.js applications. It functions as a key-value store that maintains frequently accessed data directly within the application runtime to improve response times and reduce latency. The library manages the lifecycle of stored information through automated expiration policies, which use internal timers to remove stale entries once a defined time-to-live duration has elapsed. It provides granular control over stored resources, allowing for the manual inspection, deletion, or clearing of specific keys to manage memory usage e
This library provides in-memory key-value storage with TTL expiration for Node.js applications, serving as a focused tool for managing application state and improving performance.
React Query is an asynchronous state management library and data fetching orchestrator designed to fetch, cache, and synchronize server state in web applications. It functions as a server-state cache manager that handles asynchronous data requests to keep local application state in sync with a remote server. The library implements a stale-while-revalidate cache pattern, which provides immediate access to cached data while triggering background updates to maintain consistency. It further supports optimistic user interface updates, allowing the interface to change immediately during data mutati
This library functions as a specialized cache manager for server state, providing robust in-memory caching, TTL-based expiration, and asynchronous revalidation strategies to optimize application performance.
localForage is a browser storage wrapper and key-value store that provides a unified JavaScript API for persisting data. It acts as an abstraction layer over IndexedDB, WebSQL, and localStorage, allowing web applications to save data offline. The library features a priority-based driver fallback system that automatically detects and selects the most capable storage engine available in the browser. It simplifies data management by providing an asynchronous interface for storing complex JavaScript objects and binary buffers without requiring manual serialization. The project covers broad capab
This library provides a robust asynchronous API for persistent client-side storage, serving as a foundational tool for managing application data even though it lacks built-in TTL or LRU eviction policies.
SWR is a data fetching library that provides a collection of hooks for managing remote data synchronization, caching, and state updates in web applications. It employs a declarative approach to handle complex network request lifecycles and dependency chains, ensuring that client-side application state remains consistent with server data through automatic revalidation and background updates. The library distinguishes itself through a reactive cache layer that automatically synchronizes local state with remote sources based on component lifecycle events. It features event-driven revalidation, w
SWR is a specialized data-fetching and caching library that manages remote state synchronization and in-memory caching for web applications, though it focuses more on network request lifecycles than general-purpose persistent storage.
This project provides a comprehensive suite of tools for managing asynchronous state and building full-stack web applications. At its core, it functions as a centralized synchronization layer that automates data fetching, caching, and background revalidation, ensuring that remote server data remains consistent with the local user interface. By utilizing a declarative, hook-based programming model, it simplifies the management of complex data lifecycles and loading states. The project distinguishes itself through a headless design philosophy that decouples business logic from visual presentati
This library provides a robust, hook-based caching and synchronization layer for server state, offering features like TTL-based expiration and background revalidation that effectively manage data performance in web applications.
Simple key-value storage with support for multiple backends
Keyv provides a simple key-value interface that supports both in-memory and persistent storage backends, including TTL expiration and an asynchronous API, making it a solid choice for managing application data.
A simple caching module that has set, get and delete methods and works a little bit like memcached. Keys can have a timeout (ttl) after which they expire and are deleted from the cache. All keys are stored in a single object so the practical limit is at around 1m keys.
This library provides in-memory caching with TTL expiration, serving as a straightforward tool for managing data in memory even though it lacks persistent storage and multi-level caching features.
Level is a database library that provides a unified interface for managing sorted key-value data. It functions as an abstraction layer that allows applications to store and retrieve binary information consistently across server-side environments and web browsers. The project utilizes a modular architecture that supports pluggable storage backends, enabling the system to adapt to different host environments while maintaining identical behavior. By organizing data in lexicographical order, it facilitates efficient range queries and ordered retrieval. The library handles large datasets through a
This is a database abstraction layer that provides persistent storage with asynchronous APIs, serving as a foundational tool for building caching systems even though it lacks built-in TTL or LRU policies.
This project is a native Windows port of the Redis in-memory key-value store. It provides a high-speed database that maintains datasets in RAM while using periodic snapshots to disk for data persistence. The implementation includes a background system service wrapper, allowing the data store to be installed as a Windows service that starts automatically upon computer boot. It utilizes native Windows compilation to enable execution directly on the host operating system. The system covers in-memory data caching and local data persistence, ensuring that information is recovered after a process
This is a standalone, server-side key-value database rather than a JavaScript library designed to be integrated into an application's runtime for caching.
DiskLruCache is a disk-backed key-value cache library for Android and Java environments that stores data on the filesystem within a configurable byte limit. It uses a least-recently-used (LRU) eviction policy to automatically remove old entries when the cache exceeds its allocated size, and maintains a journal file to reconstruct its in-memory state after a process restart. The cache provides atomic write operations that first write new data to a temporary file before atomically renaming it, preventing partial or corrupted reads during concurrent access. It returns frozen snapshots of cache e
This is a disk-backed cache library for Java and Android environments, which does not support the JavaScript runtime or the asynchronous API requirements specified for your project.
This is a thread-safe in-memory cache library for Go that automatically evicts the least recently used items when capacity is reached. It provides a fixed-size memory cache designed to maintain a constant memory footprint by removing the oldest entries as new data arrives. The system includes an eviction manager that executes custom callbacks when entries are purged to facilitate resource cleanup. It also supports time-based expiration, allowing for the automatic removal of items after a specified time-to-live duration. The library covers general caching capabilities including cache inspecti
This is a Go-based in-memory caching library, which does not fit the requirement for a JavaScript-based solution for managing application data.
| Repository | Stars | Language | License | Last push |
|---|---|---|---|---|
| isaacs/node-lru-cache | 5.9K | JavaScript | BlueOak-1.0.0 | |
| ptarjan/node-cache | 1.6K | JavaScript | BSD-2-Clause | |
| tannerlinsley/react-query | 49.8K | TypeScript | MIT | |
| mozilla/localforage | 25.8K | JavaScript | Apache-2.0 | |
| vercel/swr | 32.4K | TypeScript | MIT | |
| tanstack/query | 49.8K | TypeScript | MIT | |
| jaredwray/keyv | 3.1K | TypeScript | MIT | |
| node-cache/node-cache | 2.4K | CoffeeScript | MIT | |
| level/level | 1.7K | JavaScript | MIT | |
| redis-windows/redis-windows | 3.5K | Batchfile | apache-2.0 |