Caching in Python

6 projects in Database & Storage. Most starred: django-redis, diskcache and cachetools.

cachetools extends the idea of functools.lru_cache with LRU, LFU and TTL caches and decorators, all in memory and per process. diskcache stores entries in SQLite and files, so the cache survives restarts and is shared between processes on one machine without running a server. dogpile.cache puts a common API over backends such as Redis and Memcached and uses a lock so that only one process regenerates an expired value while others wait or serve the old one.

Hishel adds standards-compliant HTTP caching to HTTPX and Requests clients, which cuts repeated calls to slow or rate-limited APIs. In Django, django-redis is a full-featured Redis cache backend with more options than Django's built-in Redis support, and django-cacheops caches ORM querysets and invalidates them automatically when the underlying models change.

General3

cachetools

Extensible memoizing collections and decorators.

2.8kupdated today

diskcache

SQLite and file backed cache backend, compatible with Django.

2.9kupdated 2y ago

dogpile.cache

A caching API for Redis, Memcached, and others, with coordinated value regeneration.

301updated 2mo agorel_1_5_0

HTTP Responses1

hishel

RFC 9111 compliant HTTP caching for clients like httpx and requests and servers like FastAPI, with sync and async support.

416updated 19d ago1.4.0

Django2

django-redis

Full-featured Redis cache backend for Django.

3.1kupdated 5d ago7.0.0

django-cacheops

A slick ORM cache with automatic granular event-driven invalidation.

2.3kupdated 6mo ago
Esc

Type to search every entry. ↑↓ to move, Enter to open.