http-cache

Add an HTTP caching layer to Swift APIClient networking code.

Updated Mar 15, 2026
One-click install
npx skills add https://github.com/jtvaris/sunday-night-dynasty --skill http-cache-jtvaris
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: http-cache
Source: https://github.com/jtvaris/sunday-night-dynasty/tree/main/.agents/skills/generators/http-cache
Command: npx skills add https://github.com/jtvaris/sunday-night-dynasty --skill http-cache-jtvaris

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps developers add a configurable HTTP caching layer to their networking stack, reducing redundant API calls and enabling offline fallback while respecting server caching headers.

Core Features & Use Cases

  • Cache-Control parsing, per-endpoint caching policies, and ETag/Last-Modified conditional requests.
  • Stale-while-revalidate support and offline operation to improve UX during network outages.
  • Decorator-based integration (CachingAPIClient) that wraps an existing APIClient without changing call sites.

Quick Start

Instantiate a base API client and wrap it with CachingAPIClient to enable HTTP response caching per endpoint.

Frequently Asked Questions about http-cache

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add offline support and HTTP caching to my Swift networking code?

You can add HTTP caching to Swift networking code by wrapping your base APIClient with a decorator-based CachingAPIClient. This approach enables offline fallback and reduces redundant API calls without altering existing call sites.

How does stale-while-revalidate work for Swift API requests?

Stale-while-revalidate allows your Swift API requests to return stale cached data immediately while triggering a background network request to update the cache. This mechanism improves application UX during periods of slow network connectivity.

Can I use ETag and Last-Modified headers to validate cached API responses in Swift?

Yes, you can use ETag and Last-Modified headers to validate cached API responses in Swift. The caching layer parses these server headers to make conditional requests, ensuring your application only downloads payloads when they have actually changed.

How do I configure per-endpoint caching policies in my Swift APIClient?

You can configure per-endpoint caching policies by applying specific rules within your Swift APIClient architecture. The caching layer respects server Cache-Control headers while allowing you to define distinct caching behaviors for individual endpoints.

What is the best way to implement a disk and memory cache for Swift networking?

The best way to implement a disk and memory cache for Swift networking involves using a decorator pattern that wraps your existing APIClient. This integration respects HTTP caching headers and provides offline operation capabilities.

Do I need to change my existing API call sites to add HTTP caching in Swift?

No, you do not need to change existing API call sites to add HTTP caching in Swift. The caching layer integrates via a decorator-based CachingAPIClient that transparently wraps your base APIClient implementation.