WSGI middleware for sessions and caching