Change wsgi.py to thread cache loading