Twig is a PHP implementation of the Python templating engine Jinja. The original implementation was made by Jinja's creator Armin Ronacher. He did however hand over the project to Symphony framework creator Fabien Potencier. Though Jinja and Twig look and feel very similar their APIs are different.
I contributed multiple documentation recipes on how to cache templates using the then popular APC cache module. At the time my recipes made sense, but the ecosystem has changed a lot since then and the recipes have been removed due to being obsolete.