Changed the way metadata is cached