aiohttp-client-cache
Persistent cache for aiohttp requests
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and solves a genuine problem for async Python applications that make repeated HTTP requests. It is particularly valuable if you are already using aiohttp and need transparent caching without rewriting your session logic. The permissive MIT license and support for multiple backends make it flexible for both development and production use.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later; backend-specific optional dependencies (e.g., redis, pymongo) needed only if using those storage backends.
- Low friction: pure Python wheel with five straightforward dependencies (aiohttp, attrs, itsdangerous, typing-extensions, url-normalize).
- Actively maintained as of 2026-01-07, with recent commits and no known vulnerabilities.
License · maintenance · safety
MIT License (permissive) — MIT License permits commercial and private use with minimal restrictions; you must include a copy of the license in distributions.
last release 2026-01-07 (219 days) · last repo commit 2026-08-06 · 154 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 222,186 downloads/mo, #9,268 on PyPI
Alternatives
Verify before relying
pip install aiohttp-client-cache
from aiohttp_client_cache import CachedSession, SQLiteBackend
async with CachedSession(cache=SQLiteBackend('demo_cache')) as session:
await session.get('http://example.com')- Whether all five runtime dependencies are truly required or if some are optional for specific backends.
- Performance overhead of cache lookup compared to uncached aiohttp requests.
- Concurrency behavior and thread-safety guarantees when multiple tasks access the same cache simultaneously.
What it is and what it does
aiohttp-client-cache wraps aiohttp.ClientSession to transparently cache HTTP responses, avoiding redundant network requests for identical URLs. It is designed as a drop-in replacement: you instantiate CachedSession with a cache backend instead of ClientSession, and responses are automatically stored and reused according to your configuration.
The package supports multiple storage backends—SQLite (file-based, no external service), Redis, MongoDB, DynamoDB, and DragonflyDB—so you can choose persistence that fits your deployment model. You configure cache expiration per-URL pattern, HTTP method, status code, and request headers; responses can be set to never expire, expire after a fixed duration, or follow HTTP cache headers. It is built on the same principles as requests-cache but adapted for async/await workflows.
Use it for
- Speed up web scraping or API polling by caching responses and avoiding rate limits or slow servers.
- Reduce load on external APIs during development and testing by replaying cached responses.
- Build resilient microservices that can serve stale cached responses when a backend is temporarily unavailable.
- Cache responses from slow or rate-limited third-party APIs to improve application latency.
- Persist HTTP responses across application restarts using SQLite or a shared Redis instance.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, has no known vulnerabilities, low install friction, and solves a genuine problem for async Python applications that make repeated HTTP requests. It is particularly valuable if you are already using aiohttp and need transparent caching without rewriting your session logic. The permissive MIT license and support for multiple backends make it flexible for both development and production use.
Install
aiohttp-client-cache on PyPI
Before you install
Low friction: pure Python wheel with five straightforward dependencies (aiohttp, attrs, itsdangerous, typing-extensions, url-normalize). Actively maintained as of 2026-01-07, with recent commits and no known vulnerabilities.
Requires Python 3.9 or later; backend-specific optional dependencies (e.g., redis, pymongo) needed only if using those storage backends.
License in practice
MIT License permits commercial and private use with minimal restrictions; you must include a copy of the license in distributions.
Quickstart
pip install aiohttp-client-cache
from aiohttp_client_cache import CachedSession, SQLiteBackend
async with CachedSession(cache=SQLiteBackend('demo_cache')) as session:
await session.get('http://example.com')
Verify before relying
- Whether all five runtime dependencies are truly required or if some are optional for specific backends.
- Performance overhead of cache lookup compared to uncached aiohttp requests.
- Concurrency behavior and thread-safety guarantees when multiple tasks access the same cache simultaneously.
Package facts
| License | MIT License permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 5 packagesaiohttpattrsitsdangeroustyping-extensionsurl-normalize |
| Maintenance | Actively maintained 219 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 222,186 / month, #9,268 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaFramework :: AsyncIOFramework :: aiohttpIntended Audience :: DevelopersTopic :: Software Development :: Libraries :: Python ModulesTyping :: Typed |
Evidence: aiohttp_client_cache-0.14.3-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “persistent http response cache”
- aiohttp-client-cacheAdds transparent request caching to aiohttp.ClientSession, storing…
- requests-cacheAdds persistent HTTP caching to the requests library, allowing cached…
- gptcacheGPTCache provides semantic caching for LLM API calls, storing and…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also requests-cache · fastapi-cache2 · acachecontrol · cachelib · aioresponses · aiohttp-asyncmdnsresolver · aiodataloader · py-key-value-aio · cachier · hishel