5-Cache System
Each asset type gets its own cache with independent size limits and eviction strategy. Version: v3.1.0-enhanced-2026-02-15
Fetch Strategy by Asset Type
The Service Worker intercepts every fetch and routes it to the correct handler based on file type.
| Asset Type | Handler | Strategy |
|---|---|---|
| .html pages | handleHTML() | Network-first → HTML cache fallback |
| Images (.jpg .png .svg .webp) | handleImage() | Cache-first → network fetch → IMAGE cache |
| Fonts, CSS, JS | handleAsset() | Cache-first → network fallback → STATIC cache |
| .md .pdf .json documents | handleDocument() | Network-first → RUNTIME cache |
| Everything else | handleRuntime() | Stale-while-revalidate → RUNTIME cache |
PWA Install Flow
Smart install prompt with dismiss limit, remind-later, and permanent dismiss after 3 attempts.
Page loads + 3 seconds delay
The install prompt waits SHOW_DELAY_MS = 3000 before showing. This avoids an intrusive popup on first render.
Browser fires beforeinstallprompt
The event is intercepted and prevented. The deferred prompt is stored as this.deferredPrompt for later use.
Custom install banner shown
A styled A3KM-themed banner appears. Shows app name, icon preview, and "Install" / "Later" buttons. Uses dismissCount to track history.
Dismiss limit: 3 times
DISMISS_LIMIT = 3. After 3 dismissed, the prompt is permanently hidden. Remind cooldown: REMIND_AFTER_DAYS = 7.
Installed → prompt disappears
On appinstalled event, isInstalled = true. The prompt will never show again for this browser.
Auto-Update Notifier
/version.json every 6 hours. Timestamp stored in a3km_last_update_check localStorage key.version.json from server. Compares against current version string: v3.1.0-2026-02-15-enhanced. Shows banner if different.Lesser-Known Facts
On Service Worker install, these are always pre-cached: Home/index.html, Optimization/styles.css, favicon, manifest.json, offline-content-manager.js, pwa-install-prompt.js, update-notifier.js, and version.json.
LRU = Least Recently Used. When HTML cache hits 100 entries, the entry with the oldest access timestamp is deleted to make room. This means popular pages always stay cached, rarely-visited pages are evicted first.
When you switch back to an A3KM tab, realtime-github-sync.js immediately fires a sync on the window focus event. You always see fresh content when returning to the site.
Code Reference
Other Feature Guides
More deep-dives into A3KM Studio features — shortcuts, hidden tricks, mobile vs desktop comparisons and code references.