Cache templates in memory as well