Resources

100 Mobile Web / PWA resources for developers

This resource guide provides technical specifications and implementation strategies for building high-performance Progressive Web Apps (PWAs). It focuses on bridging the gap between mobile web and native experiences through Service Workers, modern Web APIs, and specific mobile performance optimizations.

PWA Core Implementation & Service Workers

  1. 1

    Web App Manifest Configuration

    beginnerstandard

    Define 'display': 'standalone' and 'theme_color' in manifest.json to ensure the browser UI is removed and the status bar matches your brand on Android.

  2. 2

    Workbox GenerateSW

    beginnerhigh

    Use the Workbox CLI or build tool plugin to automatically generate a service worker that handles precaching for all assets in your build folder.

  3. 3

    Stale-While-Revalidate Strategy

    intermediatehigh

    Implement Workbox's StaleWhileRevalidate for API calls to serve cached content immediately while updating the cache in the background.

  4. 4

    Service Worker SkipWaiting

    intermediatemedium

    Add a 'message' event listener to call self.skipWaiting() allowing new service workers to activate immediately without waiting for tab closure.

  5. 5

    Apple Touch Icons

    beginnerstandard

    Include <link rel='apple-touch-icon' sizes='180x180' href='/icon.png'> because iOS ignores the Web App Manifest for home screen icons.

  6. 6

    Background Sync API

    advancedmedium

    Use the SyncManager to defer actions like form submissions until the user has a stable internet connection.

  7. 7

    Cache Storage API Purging

    intermediatestandard

    Implement a cache-cleanup function during the 'activate' event to delete outdated cache versions and free up mobile storage.

  8. 8

    Vite PWA Plugin

    beginnerhigh

    Integrate vite-plugin-pwa for zero-config manifest generation and service worker registration in Vue or React projects.

  9. 9

    Web Share API

    beginnerstandard

    Invoke navigator.share() to trigger the native mobile sharing sheet for text, URLs, or files instead of custom UI overlays.

  10. 10

    Navigation Preload

    advancedhigh

    Enable navigationPreload in your service worker to start network requests for the main page before the service worker has finished booting.

  11. 11

    App Badge API

    intermediatemedium

    Use navigator.setAppBadge(count) to show a notification count on the installed PWA icon on supported platforms like Android and macOS.

  12. 12

    Custom Install Prompt

    intermediatemedium

    Capture the 'beforeinstallprompt' event to show a custom in-app button for installation rather than relying on browser banners.

Mobile Performance & UI Optimization

  1. 1

    CSS Viewport Fit Cover

    beginnerhigh

    Add 'viewport-fit=cover' to your meta viewport tag and use 'env(safe-area-inset-top)' to handle notches on iPhone and modern Android devices.

  2. 2

    Priority Hints (fetchpriority)

    intermediatehigh

    Apply fetchpriority='high' to LCP images (like hero banners) to ensure the browser prioritizes them over scripts and styles.

  3. 3

    Content-Visibility: Auto

    advancedhigh

    Apply content-visibility: auto to long lists or off-screen sections to skip rendering work until the element approaches the viewport.

  4. 4

    Touch-Action Property

    beginnerstandard

    Use 'touch-action: manipulation' on buttons to disable the 300ms tap delay and improve perceived responsiveness on older mobile browsers.

  5. 5

    AVIF Image Support

    intermediatehigh

    Serve AVIF images via the <picture> element to reduce payload size by up to 50% compared to WebP on supported mobile browsers.

  6. 6

    Font-Display: Swap

    beginnerstandard

    Set font-display: swap in @font-face to prevent invisible text during font loading, critical for slow mobile 3G connections.

  7. 7

    CSS Containment

    advancedmedium

    Use 'contain: layout style' on independent UI components to limit the scope of browser reflows and repaints.

  8. 8

    Lighthouse Mobile Throttling

    beginnerhigh

    Always audit using the 'Mobile' preset in Lighthouse to simulate a Moto G4 on a 4G connection, revealing true performance bottlenecks.

  9. 9

    Passive Event Listeners

    intermediatestandard

    Pass {passive: true} to touch and wheel event listeners to prevent them from blocking the browser's main thread during scrolling.

  10. 10

    SVG Icon Spriting

    beginnerstandard

    Combine small UI icons into a single SVG sprite to reduce the number of HTTP requests on high-latency mobile networks.

  11. 11

    Resource Hints (Preconnect)

    beginnermedium

    Use <link rel='preconnect'> for critical third-party origins like font providers or API endpoints to resolve DNS/TLS early.

Native Integration & Offline Data

  1. 1

    Web Push API with VAPID

    advancedhigh

    Implement push notifications using VAPID keys to send system-level alerts to users even when the browser is closed.

  2. 2

    IndexedDB with idb library

    intermediatehigh

    Use the 'idb' wrapper for IndexedDB to store large amounts of structured data locally for offline-first application logic.

  3. 3

    Capacitor for Native Bridge

    intermediatemedium

    Wrap your PWA with Ionic Capacitor to access native APIs like Camera, Geolocation, and Biometrics that are restricted in standard browsers.

  4. 4

    Web OTP API

    advancedstandard

    Implement navigator.credentials.get({otp}) to automatically read SMS verification codes, reducing friction in mobile login flows.

  5. 5

    Pointer Events API

    intermediatemedium

    Standardize gesture handling (swipes, pinches) by using Pointer Events instead of separate Touch and Mouse event listeners.

  6. 6

    Persistent Storage API

    advancedhigh

    Request navigator.storage.persist() to prevent the mobile OS from automatically clearing your app's IndexedDB and Cache data under storage pressure.

  7. 7

    Contact Picker API

    advancedstandard

    Use navigator.contacts.select() to allow users to select contacts from their native address book directly into your web app.

  8. 8

    File System Access API

    advancedmedium

    Implement window.showOpenFilePicker for PWAs that require direct editing and saving of local user files on supported platforms.

  9. 9

    Screen Wake Lock API

    intermediatestandard

    Use navigator.wakeLock.request('screen') to keep the device screen on during long-running tasks like navigation or media playback.

  10. 10

    Offline Fallback Page

    beginnerstandard

    Configure your service worker to serve a static 'offline.html' page when a navigation request fails and no cache is available.

  11. 11

    Virtual Keyboard API

    advancedmedium

    Use navigator.virtualKeyboard to programmatically control keyboard behavior and adjust layouts so UI elements aren't obscured.