acachecontrol
Cache-Control for aiohttp
What it is and what it does
acachecontrol brings HTTP caching semantics to aiohttp, the popular async HTTP client library for Python. It wraps aiohttp sessions and automatically caches responses according to Cache-Control headers, reducing redundant network requests for cacheable content. The library is modeled after the synchronous CacheControl library for requests, adapting its logic to async/await patterns.
The package provides AsyncCache (an in-memory cache with configurable eviction) and AsyncCacheControl (a context manager that intercepts aiohttp requests and responses). You can customize both the cache backend (by implementing OrderedDict-like methods) and the request context manager. It supports Python 3.6 through 3.10 and runs on CPython and PyPy, though the project is still early and carries known bugs.
Use it for:
- Reduce API call volume in async web scrapers or data-collection tools by caching responses per Cache-Control directives.
- Speed up microservices that make repeated calls to the same external APIs by avoiding network round-trips.
- Build async clients for REST APIs where caching is beneficial but the default aiohttp session does not implement it.
- Prototype or test async HTTP workflows without implementing custom caching logic.
- Extend aiohttp with standards-compliant HTTP caching for compliance-sensitive applications.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Adds HTTP caching to aiohttp requests by respecting Cache-Control headers, allowing async applications to avoid redundant network calls for cacheable responses.
Yes, if you need HTTP caching in an aiohttp application and can tolerate a young, minimally-maintained library. The permissive Apache license, low install friction, and zero known vulnerabilities are in its favor. However, the aging maintenance status (200 days since last commit, 8 stars) and the author's own caveat that the library is 'still under development' with 'a lot of bugs' mean you should test thoroughly in your use case and be prepared to fork or patch if issues arise.
Install
acachecontrol on PyPI
pip
pip install acachecontroluv
uv add acachecontrolpoetry
poetry add acachecontrolInstalling acachecontrol
Before you install
Low friction: pure Python wheel with a single runtime dependency (aiohttp). Maintenance status is aging—last commit was 200 days ago and the repository has minimal stars (8)—so expect slower response to issues, though the package remains archived=false and actively released.
License in practice
Apache License 2.0 (permissive): you may use, modify, and distribute this package freely in commercial and open-source projects, with only the requirement to include a copy of the license and note any changes made.
Quickstart
import asyncio
from acachecontrol import AsyncCache, AsyncCacheControl
async def main():
cache = AsyncCache()
async with AsyncCacheControl(cache=cache) as cached_sess:
async with cached_sess.get('http://example.com') as resp:
text = await resp.text()
print(text)
asyncio.run(main())
Requires Python 3.6 or later; aiohttp must be installed separately.
Verify before relying
- Whether the library's stated 'under development' status and acknowledged bugs have been resolved since the last commit 200 days ago.
- Real-world performance impact of caching on typical aiohttp workloads.
- Compatibility with recent aiohttp versions beyond what the classifiers declare.
Package facts
| License | Apache License 2.0 (permissive) |
| Python support | supports the current Python release (<4.0,>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — aiohttp |
| Maintenance | aging — 200 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 529,516/month — #6,160 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: acachecontrol-0.3.7-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
CacheControlCacheControl wraps requests sessions to…
permissive · top 1,000 on PyPI
requests-cacheAdds persistent HTTP caching to the requests…
permissive · top 5,000 on PyPI
aiohttp-client-cacheAdds transparent request caching to…
permissive · top 15,000 on PyPI
apeyeapeye provides pathlib-like URL objects, a…
copyleft · top 5,000 on PyPI
async-cacheIn-memory async cache for Python applications…
permissive · top 15,000 on PyPI
aioresponsesMocks HTTP requests made by aiohttp's…
permissive · top 5,000 on PyPI
asyncacheProvides decorator-based caching for async…
permissive · top 5,000 on PyPI
aiointerceptIntercepts aiohttp client requests by routing…
permissive · top 15,000 on PyPI
pytest-aiohttpPytest plugin that provides fixtures for…
permissive · top 5,000 on PyPI
asyncio-throttleProvides a simple async context manager to…
permissive · top 15,000 on PyPI