django-cache-memoize
Django utility for a memoization decorator that uses the Django cache framework.
Decision gist · record as of 2026-08-14
Yes, if you use Django and need simple function-level caching. The package is stable, actively maintained, has no external dependencies, and integrates cleanly with Django's cache framework. The MPL-2.0 copyleft license requires source disclosure if you modify and redistribute, but poses no restriction for typical use as a library dependency.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Django to be installed and configured with a cache backend (e.g., memcached, Redis, or database cache).
- Low friction install with no runtime dependencies.
- Actively maintained with recent commits and a stable release history since 2017.
License · maintenance · safety
MPL-2.0 (copyleft) — Licensed under MPL-2.0, a copyleft license. You must disclose source code modifications and distribute under the same license if you modify and redistribute the package.
last release 2024-12-18 (604 days) · last repo commit 2026-08-01 · 169 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 248,224 downloads/mo, #8,671 on PyPI
Alternatives
Verify before relying
pip install django-cache-memoize
from django_cache_memoize import cache_memoize
@cache_memoize(100)
def expensive_function(start, end):
return sum(range(start, end))
result = expensive_function(0, 1000)- Whether Django is an implicit peer dependency or if the decorator works outside Django projects
- Performance overhead of the decorator relative to direct cache calls
- Behavior when Django cache backend is not configured
What it is and what it does
django-cache-memoize is a lightweight decorator that wraps function calls and caches their results using Django's cache framework. It automatically generates cache keys from function arguments and keyword arguments, respecting a configurable timeout. The decorator works with Django's pluggable cache backends and handles pickling constraints transparently.
The package is designed for Django views and utility functions where repeated calls with the same arguments should return cached results. It offers advanced features like custom argument rewriting for complex objects, cache hit/miss callbacks for instrumentation, exception caching, and a guard mode that prevents repeated execution without storing results. The result must be pickleable to work with Django's cache framework.
Use it for
- Cache expensive database queries in Django views to reduce load across repeated requests
- Memoize complex calculations in utility functions with automatic timeout-based invalidation
- Instrument cache performance by tracking hits and misses via callbacks for monitoring
- Prevent duplicate API calls or background jobs by using store_result=False as a guard
- Cache function results across multiple Django cache backends by specifying cache_alias
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you use Django and need simple function-level caching.
The package is stable, actively maintained, has no external dependencies, and integrates cleanly with Django's cache framework. The MPL-2.0 copyleft license requires source disclosure if you modify and redistribute, but poses no restriction for typical use as a library dependency.
Install
django-cache-memoize on PyPI
Before you install
Low friction install with no runtime dependencies. Actively maintained with recent commits and a stable release history since 2017.
Requires Django to be installed and configured with a cache backend (e.g., memcached, Redis, or database cache).
License in practice
Licensed under MPL-2.0, a copyleft license. You must disclose source code modifications and distribute under the same license if you modify and redistribute the package.
Quickstart
pip install django-cache-memoize
from django_cache_memoize import cache_memoize
@cache_memoize(100)
def expensive_function(start, end):
return sum(range(start, end))
result = expensive_function(0, 1000)
Verify before relying
- Whether Django is an implicit peer dependency or if the decorator works outside Django projects
- Performance overhead of the decorator relative to direct cache calls
- Behavior when Django cache backend is not configured
Package facts
| License | MPL-2.0 copyleft |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 604 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 248,224 / month, #8,671 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: Web Environment :: MozillaFramework :: DjangoIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseLicense :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)Programming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Internet :: WWW/HTTP |
Evidence: django_cache_memoize-0.2.1-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 › “memoization decorator django”
- django-cache-memoizeA decorator that caches function results using Django's cache…
- django-memoizeCaches function and method results in Django applications using…
- memoizationDecorator-based function result caching with configurable TTL,…
Give your agent the search over MCP, or paste the wish link into any chat.
More WWW/HTTP packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
h11 is a pure-Python HTTP/1.1 protocol implementation that handles parsing and serializing HTTP messages without any built-in I/O, letting you integrate it with any network layer you choose.
HTTPX is a fully featured HTTP client library for Python that provides both sync and async APIs, with support for HTTP/1.1 and HTTP/2, plus an integrated command-line client.
Install it if you are building new projects or modernizing existing ones that rely on HTTP.
A minimal low-level HTTP client library that sends HTTP requests with thread-safe and task-safe connection pooling, supporting HTTP/1.1, HTTP/2, proxies, and both sync and async interfaces.
aiohttp is an async HTTP client and server framework built on asyncio, supporting both WebSockets and middleware-based routing for building concurrent web applications.
Install it if you need async HTTP client or server capabilities in asyncio-based applications.
See also django-memoize · memoization · py-memoize · cached_method · asyncache · django-cacheops · cachetools-async · cachier · django-cachalot · propcache