Spec

Offline Support

Overview

The website supports full offline browsing for public portfolio content using standard Progressive Web App (PWA) technologies combined with Blazor Static Server-Side Rendering (Static SSR).

Offline Capabilities

  • Service Worker (service-worker.js):
    • Automatically precaches core static assets (stylesheets, fonts, icons, JavaScript, and main navigation pages /, /work, /projects, /software, /hobbies).
    • Implements a cache-first with network-fallback strategy for static assets.
    • Intercepts navigation requests when offline to serve cached pages or the offline fallback screen.
  • Offline Manifest Endpoint (/api/offline-manifest):
    • Dynamically returns a JSON manifest containing all static routes, detail items (/item/{category}/{slug}), and required assets based on compiled portfolio data.
  • Download for Offline UI (offline.js / MainLayout.razor):
    • Provides a one-click "Download for offline" button in the footer that crawls the entire portfolio manifest and populates the offline cache with real-time percentage progress.
    • Automatically tracks online/offline network transitions (navigator.onLine), displaying an offline banner when disconnected and an online/offline badge in the footer.
  • Online-Only Page Protection:
    • Account and interactive pages (/login, /register, /admin, /admin/time, /members) require live server connectivity and are gracefully intercepted with an informative message when offline.