Move the cache functions inside load() to take advantage of the closure.

This allows them to use the request object & its logger & metrics.