sqlalchemy

dogpile.cache: Cache Python Data Across Backends

dogpile.cache is a Python caching API built on dogpile's locking mechanism. It gives applications a common interface to cache backends such as Redis, Memcached, databases, and in-memory dictionaries.

MaintainedPythonMITLibraryDatabaseCaching
Stars
299
Forks
51
Stars, last 8 days
+0
Last commit
2 months ago
Contributors
50

Our take

Maintaineda few commits in the last 90 days

Health score

32/100

How it is scored
Activity
31
Community
54
Issues
21
Pull requests
21

+0 stars in the last 8 days

dogpile.cache is a focused Python caching library with multiple backend options and a clear concurrency model, though recent development activity is light and concentrated in one contributor.

Good fit if

  • Your application is Python 3.10 or newer and needs a common API across supported cache backends.
  • You need cache refresh coordination, especially the ability to serve an old value while a replacement is created.
  • MIT licensing and a project maintained as part of the SQLAlchemy Project suit your use.

Look elsewhere if

  • You need a project with frequent releases or broader recent issue and pull-request activity. There has been no release in over a year, and recent commits are few.
  • Your team requires development and maintenance to be spread across contributors. Most of the code comes from one person.
  • You need a caching service rather than a Python library, or a backend not available in the project and do not want to implement one.
All health signals
Last commit2026-08-11 (2 months ago)
Commits, last 90 days2
Releases, last 12 months0 (latest rel_1_5_0, 2025-10-11)
Contributors50 (top contributor: 77% of commits)
Issues closed, last 90 days0
Pull requests merged, last 90 days0
Project age7 years

Checked on 2026-10-15 with the GitHub API.

Overview

dogpile.cache is a Python caching API built on dogpile, the locking subsystem that coordinates creation of cached values. It gives applications a consistent way to use different storage backends and helps prevent multiple workers from recreating the same expired value at once.

The project is intended for Python applications that want configurable cache regions, standard cache operations, or function-level caching without binding application code to one storage system. Included backends cover Redis, several Memcached clients, a DBM file, and a plain dictionary; the project also allows third-party backends.

Key Features

  • Define cache regions with a backend, options, and default expiration.
  • Use get, set, and delete operations or a function decorator.
  • Customize function cache keys and optionally transform keys with a key mangler.
  • Coordinate value creation with dogpile locks, allowing readers to use an older value while a new one is created.
  • Use backend-specific distributed locks where available, or a regular thread mutex.
  • Choose from included Memcached, Redis, DBM, and dictionary backends.
  • Register custom backends directly or through setuptools entry points.

Use Cases

  • Python web applications can cache expensive function results while allowing concurrent requests to reuse an existing value during refresh.
  • Teams using Redis or Memcached can add caching behind a shared API rather than coupling application logic to a specific backend.
  • Applications with modest local caching needs can use the dictionary backend, or DBM when file-based storage is appropriate.
  • Developers can add a backend for a storage system that is not included, using the project's backend interface.

What you need

Detected in the repository

  • Python >=3.10 (from pyproject.toml)
  • A test suite

License in plain words

MITpermissive

  • Commercial use: yes
  • Modify and redistribute: yes
  • You must keep: the copyright and license notice
  • Share your changes: no

A summary, not legal advice: the LICENSE file is what applies.

Getting Started

The README does not specify an installation command. See the README and documentation for setup and configuration details.

Considerations

The project requires Python 3.10 or newer. Its health data indicates a maintained but quiet project: there have been only a few recent commits, no release in over a year, and no recent issue closures or merged pull requests. Although it has many contributors overall, contribution is concentrated, with most code attributed to one person. The project is MIT-licensed. Its README describes several included backends, but teams needing another storage system may need to build and maintain a custom backend.

Found this useful?

Share it with someone who would like dogpile.cache.