Added document caching.