Move caching layer into client