Feature Deep Dive

PWA — Offline, Caching & Install System

A3KM Studio is a full Progressive Web App. It can be installed to your home screen, works offline, auto-updates silently, and uses a sophisticated 5-cache Service Worker with LRU eviction for smart storage management.

A3KM Studio একটি পূর্ণ PWA — home screen-এ install করা যায়, offline কাজ করে, auto-update হয়। Service Worker v3.1.0-enhanced ব্যবহার করে 5 ধরনের cache এবং LRU eviction সহ smart storage management।

SW v3.1.0-enhanced Offline Ready Installable Auto-Update
Cache Architecture

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

STATIC
Core Assets
CSS, JS, fonts, favicon, manifest — never evicted
HTML
Max 100 pages
All .html pages. LRU evicts oldest when limit hit.
RUNTIME
Max 200 entries
API responses, JSON, dynamic script/style
OFFLINE
Precached
Offline fallback page — shown when network fails
IMAGES
Max 150 images
All site images. LRU evicts when limit exceeded.
Cache Routing

Fetch Strategy by Asset Type

The Service Worker intercepts every fetch and routes it to the correct handler based on file type.

Asset TypeHandlerStrategy
.html pageshandleHTML()Network-first → HTML cache fallback
Images (.jpg .png .svg .webp)handleImage()Cache-first → network fetch → IMAGE cache
Fonts, CSS, JShandleAsset()Cache-first → network fallback → STATIC cache
.md .pdf .json documentshandleDocument()Network-first → RUNTIME cache
Everything elsehandleRuntime()Stale-while-revalidate → RUNTIME cache
Install Prompt

PWA Install Flow

Smart install prompt with dismiss limit, remind-later, and permanent dismiss after 3 attempts.

1

Page loads + 3 seconds delay

The install prompt waits SHOW_DELAY_MS = 3000 before showing. This avoids an intrusive popup on first render.

2

Browser fires beforeinstallprompt

The event is intercepted and prevented. The deferred prompt is stored as this.deferredPrompt for later use.

3

Custom install banner shown

A styled A3KM-themed banner appears. Shows app name, icon preview, and "Install" / "Later" buttons. Uses dismissCount to track history.

4

Dismiss limit: 3 times

DISMISS_LIMIT = 3. After 3 dismissed, the prompt is permanently hidden. Remind cooldown: REMIND_AFTER_DAYS = 7.

5

Installed → prompt disappears

On appinstalled event, isInstalled = true. The prompt will never show again for this browser.

Update System

Auto-Update Notifier

6-Hour Check Interval
Checks /version.json every 6 hours. Timestamp stored in a3km_last_update_check localStorage key.
version.json Comparison
Fetches version.json from server. Compares against current version string: v3.1.0-2026-02-15-enhanced. Shows banner if different.
Non-intrusive Banner
Update notification slides in at bottom of screen. "Update Now" triggers page reload. Works for both PWA and browser tab.
PWA + Browser
Same update system works whether the site is installed as a PWA on your home screen or opened in a browser tab.
Hidden Details

Lesser-Known Facts

CORE_ASSETS precached on install

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 eviction in detail

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.

Real-time GitHub sync on tab focus

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.

Technical Details

Code Reference

Key Files
Service Worker
Optimization/service-worker.js
SW Version
v3.1.0-enhanced-2026-02-15
HTML cache limit
MAX_HTML_CACHE = 100
Runtime cache limit
MAX_RUNTIME_CACHE = 200
Image cache limit
MAX_IMAGE_CACHE = 150
Install prompt JS
Optimization/pwa-install-prompt.js
Install dismiss limit
DISMISS_LIMIT = 3
Remind after days
REMIND_AFTER_DAYS = 7
Update notifier JS
Optimization/update-notifier.js
Update check interval
6 hours
Last check key
localStorage: a3km_last_update_check
Current version string
v3.1.0-2026-02-15-enhanced
Version file
version.json (root)
Manifest
mobile/manifest.json
Explore More

Other Feature Guides

More deep-dives into A3KM Studio features — shortcuts, hidden tricks, mobile vs desktop comparisons and code references.