Skip to main content
.env

Caching function results

Results are cached by the function’s arguments, so each distinct call gets its own entry.

Caching route responses

cache_response varies on the current user by default. On a genuinely public page pass vary_on_user=False, or every visitor gets their own copy of an identical response.

Direct access

The memory backend is per-process. Under gunicorn --workers 4 each worker keeps its own cache, so a hit rate looks worse than it is and invalidation reaches only one worker. Use redis whenever you run more than one process.