-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Overview
Implement the HTTP-layer cache for whurl. This layer intercepts GET/HEAD requests, uses HTTP caching headers (ETag, Last-Modified, Cache-Control) to serve fresh or revalidated responses, and minimizes redundant network requests.
Acceptance Criteria
- Intercept all GET/HEAD requests via a transport/middleware.
- Compute cache keys using method, URL, and Vary headers.
- Store responses with status, headers, body, ETag, Last-Modified, and computed TTL (Cache-Control/Expires).
- Prefer revalidation (If-None-Match/If-Modified-Since) over arbitrary TTL when possible.
- Respect Cache-Control directives (no-store, no-cache, private), Vary, and common cacheable statuses (200, 301, 404).
- Provide in-memory (LRU) backend, with optional disk persistence.
- Expose configuration: cache size, default TTL, backend selection.
- Implement explicit invalidation methods.
- Document integration patterns and supported options.
- Comprehensive tests for cache behavior, revalidation, and performance improvement.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request