Cache templates by type.