Funkycache caches Python functions in SQLite with automatic invalidation

Funkycache: A Python library to cache functions in SQLite

Alex Chan built funkycache, a Python library that caches function results in SQLite using a decorator modeled on functools.cache. It stores arbitrary Python objects as inputs and outputs, hashes arguments with XXH64 for compact keys, and invalidates caches when source files, dependent files, or specified values change. The library materializes lazy generators and enforces a memory budget. Chan's static site now builds with a warm cache in about half a second.

I was so unsure of this code that I deleted the cache whenever I built the site for publication.

More from this day

2026-11-19