Skip to main content

NullCache.add()

Return True without storing anything: the key is always absent, so the add succeeds.

Usage

Source

NullCache.add(
    key,
    value,
    expire=None,
)

With caching off, every caller’s add() succeeds, so don’t rely on it for job claims or locks. A Cache(durable=True) does the opposite when a write fails: its add() returns False.