Add caching, TODO diff implementation.