You should not rely environment variables for configuration. The user can use the config file and set environment variables directly from there.

I'd remove the changes on lib/cache.py