--- id: acachecontrol version: "0.3.7" license: Apache License 2.0 license_treatment: permissive maintenance: aging --- # acachecontrol — Cache-Control for aiohttp License: permissive · Maintenance: aging · Downloads: 529.5K/mo ## 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 above — 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 pip install acachecontrol uv add acachecontrol poetry add acachecontrol ## Installing 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_current - Install friction: low - Maintenance: aging - Downloads: 529.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags aiohttp caching, async http cache control, cache-control for aiohttp, http response caching async, aiohttp request memoization, async web client caching, aiohttp cache middleware, async-http, caching, aiohttp-plugin [View on SkillFed](https://skillfed.io/packages/acachecontrol) · [View on PyPI](https://pypi.org/project/acachecontrol/)