Added cache for metadata to improve speed and stability