Skip to content
CAI
Software that uses CAICheck a score

lepird/django-cacheops

54.1

Adequate · 10 November 2026

1.5k

lines of production code

Python

primary language

9

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Django-cacheops is a caching library for Django that provides automatic and manual queryset caching, function caching, and template fragment caching. It manages cache invalidation through event-driven updates, dependency tracking, and management commands. The system supports multiple backends including Redis, file, and in-memory caches, with a focus on transaction safety and performance.

Features

Initial release of django-cacheops 3.1.3

The project is initialized with version 3.1.3, introducing a complete ORM caching solution for Django. This release includes automatic and manual queryset caching, function caching via decorators, and granular event-driven invalidation. Key features include transparent transaction handling, dog-pile prevention, and support for Redis, file, and simple in-memory caches. The package requires Django 1.7+, Python 2.7/3.3+, and Redis 2.6+. It also adds a new \CACHEOPS\_ENABLED\ setting to globally disable caching, a \cache\_read\ signal, and \.invalidated\_update()\ for cache invalidation on updates.

(repo-wide) · high confidence

Behavioural changes

Refactored cacheops internals with new modules and Django AppConfig

The cacheops package has been refactored into distinct modules: cross.py handles Python 2/3 compatibility for pickling and hashing; jinja2.py adds Jinja2 template tags; redis.py implements a lazy Redis client with Lua scripts for cache operations; signals.py defines the cache\_read signal; transaction.py manages transaction state and SQL dirty tracking; tree.py converts query conditions to DNF; and simple.py provides the base cache implementations. The package now uses a Django AppConfig (CacheopsConfig) to install transaction support and cacheops on startup, replacing the previous manual initialization.

cacheops · high confidence

Rewrite cache invalidation and storage logic in Lua

The cacheops Lua scripts for caching and invalidation have been rewritten. The new cache\_thing.lua script handles writing data to Redis using setex and manages dependency tracking by updating scheme sets and conjunction keys. The new invalidate.lua script processes invalidation requests by calculating conjunction keys from object fields, retrieving associated cache keys via sunion, and deleting them in chunks to handle large invalidation batches. This change introduces a more robust mechanism for cache invalidation and dependency tracking, addressing previous issues with empty queries and bulk invalidation.

cacheops/lua · medium confidence

Updated Django template tag implementation for 1.9 compatibility

The cacheops template tags have been refactored to support both older and newer versions of Django. The code now attempts to import the 'TagHelperNode' and 'parse\_bits' from 'django.template.library', falling back to 'django.template.base' for older versions. Additionally, the 'decorator\_tag' method now explicitly accepts a 'takes\_context' argument, allowing template tags to access the template context. A new 'invalidate\_fragment' function has been added to support cache invalidation for template fragments.

cacheops/templatetags · high confidence

Updated invalidate management command to support auto-created models

The 'invalidate' management command now includes support for auto-created models, ensuring that cache invalidation applies to all models within a specified app, including those generated automatically. Additionally, the command's usage syntax has been updated to explicitly show the new capability for invalidating entire apps, specific models, or particular instances. A new 'cleanfilecache' command was also added to allow users to clean the file-based cache directory.

cacheops/management · high confidence

Test coverage

Added test suite and benchmarking infrastructure

Added a comprehensive test suite for the cacheops library, including models, fixtures, and test cases covering query caching, invalidation, and transaction support. Also added a benchmarking framework to measure performance of common operations like pickle/unpickle, cache hits/misses, and object invalidation.

tests · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 54 → 54 (-0.0)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 97 → 97 (+0.0)
  • Architecture 99 → 99 (-0.3)
  • Maturity 38 → 38 (+0.0)
  • Readiness 41 → 41 (+0.0)
  • Security 84 → 84 (+0.0)
  • Domain Modelling 100 → 100 (+0.0)

Findings

  • No change — the same findings as the prior survey.

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

lepird/django-cacheops was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 10 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 18cefb3b41b058ede33041732098c2e3da4d1b57 — the exact code this score is about.
  • Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.4+preprod-464a0040a931.