Integrates caching into the instrumentation middleware.