doc and image caching