http-cache

Implement HTTP response caching with Cache-Control parsing and ETag validation.

1|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/venomez-viper/PathWise --skill http-cache-venomez-viper
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: http-cache
Source: https://github.com/venomez-viper/PathWise/tree/main/.claude/skills/generators/http-cache
Command: npx skills add https://github.com/venomez-viper/PathWise --skill http-cache-venomez-viper

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Generating a production-grade HTTP caching layer that parses Cache-Control headers, handles ETag/Last-Modified validation, supports stale-while-revalidate, and provides offline fallback to reduce API calls and improve responsiveness.

Core Features & Use Cases

  • Cache-Control directive parsing and per-endpoint policies
  • ETag and Last-Modified conditional requests with 304 handling
  • Stale-while-revalidate and offline fallback for robust UX
  • Disk+memory caching with LRU eviction strategy
  • Decorator integration to wrap existing API clients without changing call sites
  • Guidance for integrating with Swift networking code (no server changes required)

Quick Start

Wrap your existing API client with CachingAPIClient and configure a DiskHTTPResponseCache to start caching API responses immediately.

Frequently Asked Questions about http-cache

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

FAQPage Schema
How do I implement HTTP response caching with ETag and Cache-Control parsing?

HTTP response caching is implemented by wrapping your existing API client with a decorator that parses Cache-Control directives and handles ETag/Last-Modified conditional requests. This approach minimizes network calls and provides offline fallback support without changing call sites.

What is stale-while-revalidate and how does it improve API responsiveness?

Stale-while-revalidate is a caching pattern that serves stale cached data immediately while fetching fresh data in the background. It improves API responsiveness by reducing wait times and supports offline UX when network connectivity is unavailable.

How do I add offline support to a Swift networking client without server changes?

Offline support is added by wrapping your Swift API client with a caching decorator that uses disk and memory storage with LRU eviction. This intercepts network calls and serves cached responses when the network is unreachable, requiring no server modifications.

Can I configure per-endpoint cache policies for API-heavy applications?

Per-endpoint cache policies are fully supported, allowing different caching behaviors for each API route. You configure cache-first, default, or custom policies per endpoint to satisfy production-grade requirements for bandwidth reduction and faster responses.

What is the best way to handle 304 Not Modified responses in an HTTP cache layer?

Handling 304 Not Modified responses is managed automatically through ETag and Last-Modified conditional requests. The cache layer validates cached entries against the server, preserving stored response data when validation succeeds and reducing payload transfers.

When should I avoid using a decorator pattern for HTTP caching?

Avoid the decorator caching pattern if your application makes minimal API calls or has no offline requirements, as the disk and memory overhead provides little benefit. It is best suited for API-heavy apps needing reduced bandwidth and robust offline fallback.