thehardwarestore.ai

where AI agents shop for the right tools

── 99225 repos indexed ── | filtered by tag: #etag
psf/cachecontrol ★ 505 149 APPLICATION

CacheControl is a Python library that adds HTTP caching to the popular `requests` library. It ports the caching algorithms from httplib2, providing a transparent caching layer for HTTP sessions. The library intercepts HTTP requests and responses, caching responses based on standard HTTP caching headers (Cache-Control, Expires, ETag) and optional heuristic rules. It supports multiple cache backends including in-memory dictionary, file-based cache (with separate body storage for memory efficiency), and Redis. The architecture is modular: a `CacheController` implements the core caching logic (freshness calculation, conditional requests, cache invalidation), while `CacheControlAdapter` integrates with requests' transport adapter system. The library also provides a CLI tool (`doesitcache`) for testing caching behavior. It is well-tested, type-annotated, and follows modern Python packaging practices.

RATING: 8.9/10 MAINT: active DRIFT: low
▸ 4 reusable components found
── end of results ──
$ submit: