npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@revealui/cache

v0.4.0

Published

Cache store adapters, tag-aware createCachedFunction/revalidate*, and distributed invalidation for RevealUI.

Downloads

2,378

Readme


title: "@revealui/cache" description: "Cache store adapters and distributed invalidation for RevealUI. Memory, PGlite, and browser backends." visibility: public status: verified audience: user

@revealui/cache

Cache store adapters, tag-aware memoization, and a distributed invalidation channel for RevealUI applications.

When to Use This

  • You need a pluggable CacheStore (in-memory, PGlite, or browser/WASM)
  • You need CMS-style tag-aware data memoization (createCachedFunction + revalidateTag) without Next.js
  • You need multi-instance cache busting via CacheInvalidationChannel
  • You want a small logger hook for cache package diagnostics

Edge/CDN helpers (Cache-Control builders, ISR presets, edge rate limit, CDN purge) were removed in fleet-redundancy C11 (2026-07-23). Prefer platform-native APIs for HTML/CDN. Do not put router RSC payloads here (ADR D4: @revealui/router stays uncached).

Installation

pnpm add @revealui/cache

API Reference

Main entry (@revealui/cache)

| Export | Type | Purpose | |--------|------|---------| | CacheStore / CacheEntry | Types | Store contract | | createCachedFunction | Function | Tag-aware memoization (explicit keyParts + tags) | | revalidateTag / revalidatePath | Functions | Local-evict by tag or path tag/prefix | | getDefaultCacheStore / setDefaultCacheStore | Functions | Process default store | | CacheInvalidationChannel | Class | Distributed cache busting across store instances | | configureCacheLogger / getCacheLogger | Functions | Package logger hook |

import {
  createCachedFunction,
  revalidateTag,
} from '@revealui/cache'

const loadFooter = createCachedFunction(async () => fetchFooter(), {
  keyParts: ['global', 'footer'],
  tags: ['global_footer'],
  ttlSeconds: 300,
})

await loadFooter()
await revalidateTag('global_footer')

Adapters subpath (@revealui/cache/adapters)

| Export | Purpose | |--------|---------| | InMemoryCacheStore | Map-backed, single-process | | PGliteCacheStore | PostgreSQL-backed via PGlite | | createBrowserCache | PGlite WASM + IndexedDB | | useBrowserCache | React hook for browser cache singleton |

Design Principles

  • Adapters over monoliths — pick a store backend; do not bake CDN provider SDKs into this package
  • No Next.js peer dep — HTTP edge helpers lived here previously; app frameworks own their revalidation APIs
  • Honest surface — only ship what runtime paths use

License

MIT