Skip to content

v3.1 • Data • 5kb gzipped • MIT

QueryLite

A client-side cache with request deduplication and revalidation, in five kilobytes.

★ 2.7kGitHub
↓ 5.5k / week● MIT● TS 5.0+
querylite-preview.png
Abstract preview graphic for QueryLite

// 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.

● 17ms render● 60fps● 0 deps

// 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

v3.1 Apr 20 2026 • latest
  • Focus and reconnect revalidation
  • Deduplication across cache generations
  • Down to 5kb gzipped
v3.0.2 Feb 7 2026
  • Safari 16 compatibility fixes
  • Bundle size reduced by eleven percent
v3.0.1 Nov 9 2025
  • Improved error messages for invalid options
  • Added twenty regression tests
View full archive →

// related

Related products

Sep 10 • v2.0

ChartForge

Canvas charts in twelve lines. Responsive, accessible and dark-mode ready, with no D3 learning curve.

View →
Aug 30 • v3.2.1

MotionEase

Physics-based micro-animations with a single call. Spring curves that feel right without a tuning session.

View →
Aug 19 • v1.9.4

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.