Updates based on review comments.
Replace request_cache with a thread-local variable.
Fix remaining pylint errors.