Cache that uses map-like interface, with templates.