Branding12 min

What is a PWA and standard Progressive Web App configuration guide

An in-depth guide to PWA architecture: Service Worker lifecycle, caching strategies, manifest settings, and Android File Handlers integration.

Progressive Web App (PWA) was coined by Alex Russell and Frances Berriman in 2015 to describe web applications that utilize modern browser capabilities to deliver smooth, reliable, and installable experiences directly on any OS from a single codebase.

PWAs eliminate dependency on traditional app stores, support instant background updates, and keep users productive offline by utilizing service worker interceptors.

The Heart of PWA: Service Worker Lifecycle

A Service Worker is a client-side network proxy running in a background thread, isolated from the browser's main UI thread. It acts as an intermediary between your web app and the network, intercepting HTTP fetch requests and deciding how to serve resources.

Understanding the 4 lifecycle stages of a Service Worker is critical for proper cache invalidation and updates:

  • Installing: Triggered when a new sw.js file is registered. This is where you cache initial shell assets (HTML, CSS, JS) to prepare for offline visits.
  • Waiting: If a new Service Worker is downloaded, it waits in the background until all open tabs running the old version are closed.
  • Activating: Triggered once the old worker is released (or via skipWaiting). Perfect for deleting outdated caches and cleaning up variables.
  • Active: Controls all client pages within its scope, listening for fetch, push, and sync events.

Caching Strategies & When to Use

Choosing the right caching strategy is vital for application responsiveness and freshness. The three standard strategies are:

Cache First (Stale-While-Revalidate): Serve assets from the cache instantly for sub-millisecond loads, while fetching updates from the network in the background. Highly recommended for static assets (CSS, JS, images).

Network First: Attempt to fetch fresh data from the network. Fall back to the cached copy if the user is offline. Best for dynamic API endpoints and user feeds.

Cache Only: Serve only from the cache. Ideal for displaying offline fallback screens when there is no connectivity.

Manifest & OS Integrations

A web app manifest (manifest.json) defines your app identity on the system. In addition to basic parameters like name and display: "standalone", modern production PWAs leverage advanced OS hooks on Android and Desktop:

Note

Share Target (share_target): Registers your web app in the system Share Sheet. When users share media files or text from other apps, your PWA appears as a receiver. This requires precise MIME declarations to match system intents.

Tip

File Handlers (file_handlers): Associates your PWA with specific file extensions (e.g., .mp3, .wav). Double-clicking a file in Android File Manager or macOS Finder opens it directly inside your PWA.

json
{
  "name": "AkiTao App",
  "short_name": "AkiTao",
  "start_url": "/?source=pwa",
  "display": "standalone",
  "theme_color": "#070b14",
  "background_color": "#070b14",
  "share_target": {
    "action": "/share-target",
    "method": "POST",
    "enctype": "multipart/form-data",
    "params": {
      "title": "title",
      "text": "text",
      "files": [{ "name": "media", "accept": ["audio/mpeg", "audio/wav"] }]
    }
  }
}

iOS Safari: Opportunities and Real Constraints

Apple has historically maintained a strict stance on PWAs to protect App Store boundaries. However, Safari now supports core PWA features if you provide the required meta tags.

Warning

iOS Safari does not read the manifest.json file for installation prompts. You must define tags like apple-mobile-web-app-capable in the HTML <head> to enable full-screen, address-bar-free standalone modes.

Also, keep Safari's unique constraints in mind: cache and IndexedDB storage are wiped if the user does not launch the app for 14 consecutive days. Additionally, iOS restricts offline cache sizes much more aggressively than Android.

Debugging & Deployment

Use the Application tab in Chrome DevTools to inspect your PWA. You can monitor Service Worker status, inspect Cache Storage buckets, simulate offline states, and force-trigger worker activation.

Important

Begin by generating PWA-compliant favicon assets. You can use the AkiTao Favicon Generator to quickly create all icons and meta configurations matching native standards.