Snipped from `main/caching.py`