aiocache
multi backend asyncio cache
What it is and what it does
aiocache is an asyncio caching library that abstracts over multiple backend storage systems—in-memory, Redis, and memcached—behind a single, consistent API. It lets you cache the results of async functions and manage key-value data without rewriting code when you switch backends. The library includes decorators for transparent caching, serializers to handle Python objects, and a plugin system for hooks like timing and hit-miss tracking.
You can use it as a simple in-process cache for development, swap to Redis or memcached for production, and configure everything through a unified interface. It has no runtime dependencies by default; optional backends require their respective client libraries installed separately.
Use it for:
- Cache results of expensive async database queries in a web framework.
- Store serialized Python objects in Redis for sharing cached state across multiple processes.
- Decorate async functions with @cached to automatically memoize results with configurable TTL and namespacing.
- Switch from in-memory caching during development to memcached in production without changing application code.
- Implement multi-key operations (multi_get, multi_set) to batch cache reads and writes efficiently.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides asyncio-compatible caching with pluggable backends (memory, Redis, memcached) and a uniform interface for get, set, delete, and other standard cache operations.
Yes. aiocache is actively maintained, has no install friction, and provides a clean abstraction over multiple cache backends—valuable for async Python applications that may need to scale from development to production. The main caveat is the unclear license status; verify the actual license before committing to production use. No known vulnerabilities.
Install
aiocache on PyPI
pip
pip install aiocacheuv
uv add aiocachepoetry
poetry add aiocacheInstalling aiocache
Before you install
Low install friction with no runtime dependencies. Actively maintained with recent commits and 1437 repository stars. Supports Python 3.7 through 3.11.
License in practice
License status is unclear—no SPDX identifier or raw license text is available in the package metadata. Verify the actual license before using in proprietary or restricted contexts.
Quickstart
import asyncio
from aiocache import Cache
async def example():
cache = Cache(Cache.MEMORY)
await cache.set('key', 'value')
result = await cache.get('key')
print(result) # 'value'
asyncio.run(example())
Optional backends (Redis, memcached) need separate installation via pip install aiocache[redis] or aiocache[memcached].
Verify before relying
- Whether the package is licensed under an open-source or proprietary license (metadata shows no license declaration).
- Performance characteristics and typical throughput for each backend type.
- Whether serializers (PickleSerializer, JsonSerializer, MsgPackSerializer) are included by default or require extra dependencies.
- Minimum Python version requirement (classifiers list 3.7 through 3.11 but requires_python is unspecified).
Package facts
| License | not declared (unclear) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 688 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 8,847,386/month — #1,587 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: aiocache-0.12.3-py2.py3-none-any.whl
Tags
More Database packages
psycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
redisPython client library for connecting to and…
permissive · top 1,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
sqlparsesqlparse tokenizes SQL text into a tree of…
permissive · top 1,000 on PyPI
dbt-adaptersProvides base adapter protocols and shared…
permissive · top 1,000 on PyPI
aiomcacheAsyncio-based memcached client providing…
permissive · top 15,000 on PyPI
cachelibCacheLib provides a unified API for interacting…
permissive · top 5,000 on PyPI
cashewsAsync cache framework with decorator and direct…
permissive · top 15,000 on PyPI
fastapi-cache2Caches FastAPI endpoint and function results…
permissive · top 5,000 on PyPI
python-redis-cacheDecorator-based caching for Python functions…
permissive · top 15,000 on PyPI
django-redisProvides a Redis cache and session backend for…
permissive · top 5,000 on PyPI
python-memcachedPure Python client library for connecting to…
permissive · top 5,000 on PyPI
pylibmcpylibmc is a Python client for memcached, the…
permissive · top 15,000 on PyPI
django-cache-urlConfigures Django cache backends from…
permissive · top 15,000 on PyPI
py-key-value-aioProvides an async-only, pluggable key-value…
permissive · top 1,000 on PyPI