# grantjenks/python-diskcache

Python disk-backed cache (Django-compatible). Faster than Redis and Memcached. Pure-Python.

Repository: https://github.com/grantjenks/python-diskcache
Canonical: https://ross.abutalabs.com/products/python-diskcache
Homepage: http://www.grantjenks.com/docs/diskcache/
Language: Python
License: NOASSERTION
License Family: other
Topics: python, cache, persistence, key-value-store, filesystem
Last push: 2024-08-10T14:33:59+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 3864, "days_push": 753, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases, no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2906, forks 178 (observed 2026-08-28T04:07:29.048131+00:00)

## What it is
DiskCache is a pure-Python disk and file backed cache library with a Django-compatible API, built on SQLite and memory-mapped files. It provides persistent key-value caching with eviction policies (LRU/LFU), tag metadata, memoization, and thread/process safety without needing a separate cache server.

## Use cases
- cache gigabytes of data on disk instead of RAM in Python
- replace Redis or Memcached for local caching without running a server
- add a fast persistent cache backend to Django
- memoize expensive function results across processes
- persist a key-value store with expiration and eviction policies
- speed up web crawlers or batch jobs with a persistent queue and cache

## When to choose
- you want caching without deploying or maintaining a separate Redis/Memcached server
- your cache is larger than available memory and should persist across restarts
- you need a Django cache backend that scales better than the built-in filesystem cache
- you need thread-safe and process-safe caching in pure Python with no C compiler

## When to avoid
- you need a shared network cache across many machines
- your workload is write-heavy and disk I/O latency is unacceptable
- you need advanced Redis features like pub/sub, replication, or data structures beyond key-value
- you require an actively maintained project with frequent releases

## Facets
- artifact type: library
- maturity: stable
- function: caching, serialization
- domain: databases, web-development, developer-tools, performance
- platform: python, cross-platform
- tags: disk-cache, key-value-store, django-cache-backend, sqlite, persistent-cache, memoization, pure-python

## Member repositories
- grantjenks/python-diskcache (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:29.048131+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:48:13.563359+00:00, confidence not recorded.
  - readme: https://github.com/grantjenks/python-diskcache (fetched 2026-08-28T04:07:29.048131+00:00, sha e07517dcb77d)
  - homepage: http://www.grantjenks.com/docs/diskcache/ (fetched 2026-08-29T09:50:00.080684+00:00, sha dc85637e55bb)
  - site_page: http://www.grantjenks.com/docs/diskcache/tutorial.html (fetched 2026-08-29T09:50:00.092746+00:00, sha 3b3e019d95a3)
  - site_page: http://www.grantjenks.com/docs/diskcache (fetched 2026-08-29T09:50:00.090051+00:00, sha dc85637e55bb)
  - site_page: http://www.grantjenks.com/docs/diskcache/api.html (fetched 2026-08-29T09:50:00.095625+00:00, sha c995ba6d9418)
  - site_page: http://www.grantjenks.com/docs/diskcache/cache-benchmarks.html (fetched 2026-08-29T09:50:00.099271+00:00, sha 1dcfbcfaa9f0)
  - site_page: http://www.grantjenks.com/docs/diskcache/djangocache-benchmarks.html (fetched 2026-08-29T09:50:00.101113+00:00, sha 9cd28effd6bb)
  - site_page: http://www.grantjenks.com/docs/diskcache/case-study-web-crawler.html (fetched 2026-08-29T09:50:00.102833+00:00, sha 5b5352249cc2)
  - site_page: http://www.grantjenks.com/docs/diskcache/case-study-landing-page-caching.html (fetched 2026-08-29T09:50:00.104666+00:00, sha c72fa5685d7c)
  - site_page: http://www.grantjenks.com/docs/diskcache/sf-python-2017-meetup-talk.html (fetched 2026-08-29T09:50:00.106616+00:00, sha d4aea9a18a93)
- Data as of 2026-08-30T08:39:29.467469+00:00.
