AppCache Demo

A small TTL / dedup / stale-while-revalidate cache, built on top of a get()/set()/delete()/keys() backend interface — so the same policy logic runs unmodified whether the backend is a plain in-memory Map or the browser's native CacheStorage/Cache API (used directly from the page — no service worker needed). Compare with ServiceWorkerDemo, which uses that same native Cache API but as a cache-first proxy for network requests inside a service worker. See README.md for a step-by-step walkthrough.

TTL / dedup / tags

Config

greeting (tag: demo)

time (tag: demo)

Persistence across reload

These two populate themselves on load, backed by a fixed instance each — no setup required. Just reload the page (the button above works) and look again: whatever state you left steps above in doesn't matter.

Memory (Map)

changes every reload — a plain Map only lives as long as the page does

CacheStorage / Cache API

stays identical across reloads — really persisted by the browser

Log