Dual Window Cache (dw-cache)

JSON →
library 0.0.120 ·javascript
verified Jun 7, 2026

Dual Window Cache (DWC) is a high-performance constant-time cache algorithm in TypeScript/JavaScript, implemented in the dw-cache npm package at version 0.0.120. It claims the highest engineering hit ratio among general-purpose caching algorithms by using only two lists for low overhead and latency, with resistance to scan, loop, and burst access patterns. Unlike LIRS or TinyLFU, DWC avoids batch processing, linear-time operations, and excessive memory overhead. It ships with TypeScript types and is actively maintained. Recommended for cache sizes above 200 entries (ideally 5,000+) for optimal statistical precision. The package is a standalone implementation of the DWC algorithm, now maintained as part of the spica monorepo.