What problem does it solve?
Many Swift apps perform redundant network requests, lack per-endpoint cache control, and provide poor offline user experience. This Skill generates a transparent, production-ready HTTP caching layer to reduce API calls, save bandwidth, and enable robust offline fallback with conditional requests.
Core Features & Use Cases
- Cache-Control parsing & policy: Respect server directives, support max-age, stale-while-revalidate, and per-endpoint overrides.
- ETag / conditional requests: Add If-None-Match and If-Modified-Since handling to minimize bandwidth with 304 responses.
- Disk-backed LRU storage & reachability: Provide in-memory + disk caching with eviction and NWPathMonitor-based offline fallback for smooth UX.
- Use Case: Add caching to a Swift APIClient to return cached feed data immediately while revalidating in the background and serving stale results when offline.
Quick Start
Add a disk-backed HTTP caching layer with Cache-Control parsing, ETag conditional requests, stale-while-revalidate behavior, and offline fallback to my Swift APIClient.