Use caching to speed up map generation