http-cache

Create an HTTP caching layer parsing Cache-Control directives with ETag and Last-Modified validators.

Updated Jun 2, 2026
One-click install
npx skills add https://github.com/ano4l/SiteRent --skill http-cache-ano4l
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: http-cache
Source: https://github.com/ano4l/SiteRent/tree/main/skills/generators/http-cache
Command: npx skills add https://github.com/ano4l/SiteRent --skill http-cache-ano4l

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Generates a robust HTTP caching layer that applies to API calls, reduces network traffic, and enhances offline capabilities.

Core Features & Use Cases

  • Cache-Control parsing with max-age and stale-while-revalidate
  • ETag / Last-Modified conditional requests and 304 handling
  • Per-endpoint caching controls and offline fallback
  • Disk and memory caching with eviction (LRU-style)
  • Easy integration as a decorator around an existing API client

Quick Start

Create a ready-to-use HTTP caching layer and wire it into your API client to start serving cached responses.

Frequently Asked Questions about http-cache

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

FAQPage Schema
How do I add HTTP caching to my API client with offline fallback?

You can add HTTP caching by wrapping your existing API client with a caching decorator that parses Cache-Control directives and serves offline fallback responses when the network is unavailable.

How does stale-while-revalidate work for API responses?

Stale-while-revalidate serves cached API responses immediately while fetching fresh data in the background, utilizing parsed Cache-Control directives alongside disk and memory caches to balance performance and data freshness.

Can I control caching behavior for individual API endpoints?

Yes, the caching layer supports per-endpoint caching controls, allowing you to apply specific Cache-Control directives, ETag conditional requests, and custom eviction rules to individual GET request routes.

What's the best way to reduce API calls using ETag and Last-Modified headers?

Reduce API calls by implementing conditional requests via ETag and Last-Modified validators to handle 304 Not Modified responses, skipping full payload downloads when the server confirms the resource remains unchanged.

Does this HTTP caching layer work with both web and mobile applications?

Yes, the HTTP caching layer applies to both web and mobile apps needing reduced API calls and offline support, utilizing disk and memory LRU-style caches with eviction across standard GET requests.

Why do I need both disk and memory caching for API responses?

Disk and memory caching with LRU-style eviction ensures fast response retrieval from memory while maintaining persistent offline fallback storage on disk, preventing data loss during app restarts or network outages.