async-cache
an asyncio application layer cache and dataloader for python based microservices and applications with thundering herd protection
Decision gist · record as of 2026-08-14
Yes. The package has no runtime dependencies, installs with low friction, is actively maintained, carries no known vulnerabilities, and solves real concurrency problems (thundering herd, batch efficiency) that are difficult to handle correctly in async code. It is a solid choice for microservices and applications that need straightforward in-memory caching with async-aware deduplication.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Installs with no runtime dependencies and low friction.
- Actively maintained with recent releases; last commit 2026-05-28 and 106 repository stars indicate ongoing development.
License · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects with minimal obligations.
last release 2026-04-22 (114 days) · last repo commit 2026-05-28 · 106 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 218,109 downloads/mo, #9,344 on PyPI
Alternatives
Verify before relying
pip install async-cache
from cache import AsyncCache
cache = AsyncCache(maxsize=1000, default_ttl=300)
async def get_data(key):
return await cache.get(
key,
loader=lambda: db_query(key),
)- Whether the 5ms batching window mentioned in examples is configurable or a fixed default.
- Performance characteristics and memory overhead when maxsize approaches capacity.
- Behavior of metrics collection under very high concurrency (thread-safety guarantees).
What it is and what it does
async-cache is an in-memory application-layer cache designed for async Python microservices and applications. It stores frequently-accessed data in memory with configurable TTL (time-to-live) and LRU eviction, reducing redundant database or API calls. The core API provides a flexible `AsyncCache` class that accepts loader functions to automatically fetch and cache missing values on demand.
The package addresses two common async scaling problems: thundering herd (where many concurrent requests for the same missing key trigger many identical backend calls) and inefficient batch loading (where individual requests could be grouped into one efficient batch query). It includes decorator convenience wrappers (`AsyncLRU`, `AsyncTTL`) for simpler function-level caching, cache warmup to preload hot keys at startup, and built-in metrics (hits, misses, hit rate) for observability and monitoring integration.
Use it for
- Reduce database load in microservices by caching user profiles or configuration that multiple requests fetch concurrently.
- Implement DataLoader-style batching to group 100 concurrent user ID lookups into a single batch database query.
- Preload frequently-accessed data (hot keys) at application startup to avoid cold-start cache misses.
- Monitor cache effectiveness with built-in metrics (hit rate, size) for Prometheus or other observability systems.
- Decorate async functions to automatically cache results with TTL without rewriting function logic.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package has no runtime dependencies, installs with low friction, is actively maintained, carries no known vulnerabilities, and solves real concurrency problems (thundering herd, batch efficiency) that are difficult to handle correctly in async code. It is a solid choice for microservices and applications that need straightforward in-memory caching with async-aware deduplication.
Install
async-cache on PyPI
Before you install
Installs with no runtime dependencies and low friction. Actively maintained with recent releases; last commit 2026-05-28 and 106 repository stars indicate ongoing development.
License in practice
MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects with minimal obligations.
Quickstart
pip install async-cache
from cache import AsyncCache
cache = AsyncCache(maxsize=1000, default_ttl=300)
async def get_data(key):
return await cache.get(
key,
loader=lambda: db_query(key),
)
Verify before relying
- Whether the 5ms batching window mentioned in examples is configurable or a fixed default.
- Performance characteristics and memory overhead when maxsize approaches capacity.
- Behavior of metrics collection under very high concurrency (thread-safety guarantees).
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.3 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 114 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 218,109 / month, #9,344 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: async_cache-2.0.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 › “thundering herd protection”
- async-cacheIn-memory async cache for Python applications with TTL, LRU eviction,…
- executorWraps Python's subprocess module to simplify executing local…
- backoffProvides function decorators to automatically retry code on…
Give your agent the search over MCP, or paste the wish link into any chat.
More Application Frameworks packages
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Textual is a Python framework for building cross-platform user interfaces that run in the terminal or web browser using a modern, component-based API.
Install it if you're developing CLI tools, dashboards, or interactive terminal applications.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Build and connect to Model Context Protocol servers that expose tools, resources, and prompts to LLM applications over stdio, HTTP, or SSE transports.
Install it if you need to build or connect to servers.
Werkzeug is a WSGI utility library providing request/response objects, URL routing, an interactive debugger, HTTP utilities, and a development server for building web applications.
See also aiodataloader · async-lru · cashews · theine · cachettl · cacheout · asyncache · onecache · cachetools-async · acachecontrol