Cache templates in memory.