cache-results

Getting Started

  • Installation
    • Requirements
    • Install the package
    • Configure a cache
  • Quickstart
    • Decorate a function
    • Pass plain values
    • Clear an entry when the data changes
    • Choose the timeout

User Guide

  • Arguments and Cache Keys
    • How a key is made
    • Types that can be part of a key
    • Anything else runs uncached
    • Adding a type
    • Never pass a secret
    • A fixed key
  • Invalidation
    • When to invalidate
    • Functions with a fixed key
    • Abandoning every entry at once
    • Before Django is ready
  • Async, Concurrency and Startup
    • async functions
    • Concurrent misses
    • During startup
  • Methods and Nested Functions
    • Classmethods
    • Instance methods are refused
    • Functions defined inside an inherited classmethod
  • Settings
    • Entries
    • Decorator options
  • Logging
    • What is logged
    • Turning logging on at runtime
    • Formatting the prefix
  • Testing Your Code
    • Clear the cache between tests
    • Turn caching off
    • Call the undecorated function
    • Prove that a result is cached
    • Find uncached calls

Reference

  • API Reference
    • The Decorator
      • cache_results()
    • Cache Keys
      • CacheKeyArgumentError
      • CacheKeyEncoder
      • bind_arguments()
      • describe_key_error()
      • dumps()
      • make_key()
      • normalize()
    • Settings
      • CacheResultsSettings
      • LOG_EVENTS
      • SETTING_NAME
      • cache_results_settings
    • Sentinels
      • CACHE_MISS_SENTINEL
      • CACHE_NONE_SENTINEL
      • CacheSentinel

Project

  • Changelog
  • Contributing
    • Development setup
    • Pull requests
    • Code of conduct
  • License
  • Architectural Decision Records
    • ADR Introduction
      • Guidelines for Writing ADRs
    • ADR-001: A Standalone Package That Depends Only on Django
      • Status
      • Context
      • Decision
      • Alternatives Considered
      • Consequences
      • Related ADRs
    • ADR-002: Function Result Caching in Django’s Cache Framework
      • Status
      • Context
      • Decision
      • Alternatives Considered
      • Consequences
      • Related ADRs
    • ADR-003: Cache Keys: Bound Arguments, Never str()
      • Status
      • Context
      • Decision
      • Alternatives Considered
      • Consequences
      • Related ADRs
    • ADR-004: Settings and Hooks: One Django Setting
      • Status
      • Context
      • Decision
      • Alternatives Considered
      • Consequences
      • Related ADRs
    • ADR-005: Django Startup: Cache Only Once Apps Are Ready
      • Status
      • Context
      • Decision
      • Alternatives Considered
      • Consequences
      • Related ADRs
    • ADR-006: Async Functions and Concurrent Misses
      • Status
      • Context
      • Decision
      • Alternatives Considered
      • Consequences
      • Related ADRs
    • ADR-007: Logging
      • Status
      • Context
      • Decision
      • Alternatives Considered
      • Consequences
      • Related ADRs
    • ADR-008: Error Handling: Degrade to an Uncached Call
      • Status
      • Context
      • Decision
      • Alternatives Considered
      • Consequences
      • Related ADRs
    • ADR-009: Compatibility: Cached Entries Outlive Releases
      • Status
      • Context
      • Decision
      • Alternatives Considered
      • Consequences
      • Related ADRs
    • ADR-010: Testing
      • Status
      • Context
      • Decision
      • Alternatives Considered
      • Consequences
      • Related ADRs
    • ADR-011: CI/CD
      • Status
      • Context
      • Decision
      • Alternatives Considered
      • Consequences
      • Related ADRs
    • ADR-012: Semantic Versioning
      • Status
      • Context
      • Decision
      • Alternatives Considered
      • Consequences
      • Related ADRs
    • ADR-013: Dependency Management
      • Status
      • Context
      • Decision
      • Alternatives Considered
      • Consequences
      • Related ADRs
    • ADR-014: Docstring Style
      • Status
      • Context
      • Decision
      • Alternatives Considered
      • Consequences
      • Related ADRs
    • ADR-015: Type Annotations
      • Status
      • Context
      • Decision
      • Alternatives Considered
      • Consequences
      • Related ADRs
    • ADR-016: Code Quality
      • Status
      • Context
      • Decision
      • Alternatives Considered
      • Consequences
      • Related ADRs
    • ADR-017: Packaging
      • Status
      • Context
      • Decision
      • Alternatives Considered
      • Consequences
      • Related ADRs
    • ADR-018: Documentation
      • Status
      • Context
      • Decision
      • Alternatives Considered
      • Consequences
      • Related ADRs
cache-results
  • Architectural Decision Records
  • Edit on GitHub
Previous Next

Architectural Decision Records

Short records of the decisions that shape cache-results, each with its context, the alternatives considered, and its consequences.

  • ADR Introduction
  • ADR-001: A Standalone Package That Depends Only on Django
  • ADR-002: Function Result Caching in Django’s Cache Framework
  • ADR-003: Cache Keys: Bound Arguments, Never str()
  • ADR-004: Settings and Hooks: One Django Setting
  • ADR-005: Django Startup: Cache Only Once Apps Are Ready
  • ADR-006: Async Functions and Concurrent Misses
  • ADR-007: Logging
  • ADR-008: Error Handling: Degrade to an Uncached Call
  • ADR-009: Compatibility: Cached Entries Outlive Releases
  • ADR-010: Testing
  • ADR-011: CI/CD
  • ADR-012: Semantic Versioning
  • ADR-013: Dependency Management
  • ADR-014: Docstring Style
  • ADR-015: Type Annotations
  • ADR-016: Code Quality
  • ADR-017: Packaging
  • ADR-018: Documentation
Previous Next

© Copyright 2026, Lawrence McDaniel.

Built with Sphinx using a theme provided by Read the Docs.

cache-results is part of The Smarter Project, an open-source platform for building and running AI applications with Django.