v3.1 • Data • 5kb gzipped • MIT
QueryLite
A client-side cache with request deduplication and revalidation, in five kilobytes.

// why querylite
Small enough to not think about
Deduplication, stale-while-revalidate and focus refetching in a fifth of the bytes of the usual answer.
// stack
Transport agnostic
Give it any function that returns a promise. Fetch, GraphQL client, or a mock during tests.
QueryLite started as a single file in a client project and stayed small on purpose. It does one job, it does it in 5kb gzipped, and it has no runtime dependencies.
Getting started
Install it, import it, call it:
npm i querylite-js
Deduplication, stale-while-revalidate and focus refetching in a fifth of the bytes of the usual answer.
What it does not do
It does not manage your state, style your components or ship a plugin system. Those are your decisions, and keeping them out is what keeps the bundle honest.
- Request deduplication
- Stale-while-revalidate
- MIT licensed, commercially friendly
Features
Request deduplication
Ten components asking for the same key produce exactly one request.
Stale-while-revalidate
Cached data renders instantly while a fresh copy loads behind it.
Export built in
One call produces PNG, SVG or the underlying values as CSV.
Six themes
Token-driven, so bringing your own palette is a single object.
ESM and types
Ships module and CommonJS builds with hand-written type definitions and source maps.
Off the main thread
Heavy work moves to a worker automatically when one is available.
Get QueryLite v3.1
8 files • .min.js 5kb • .zip 40kb • sha384 verified
Changelog
- Focus and reconnect revalidation
- Deduplication across cache generations
- Down to 5kb gzipped
- Safari 16 compatibility fixes
- Bundle size reduced by eleven percent
- Improved error messages for invalid options
- Added twenty regression tests
// related
Related products
ChartForge
Canvas charts in twelve lines. Responsive, accessible and dark-mode ready, with no D3 learning curve.
View →MotionEase
Physics-based micro-animations with a single call. Spring curves that feel right without a tuning session.
View →FormFlow
Validation and multi-step logic that works the same in React, Vue and vanilla. Your markup stays yours.
View →Ship the dashboard today.
MIT licensed. Commercial friendly. Five-minute setup.