ecometer

Use a templating engine

(Development)
#61

Templating engines, like Smarty and Twig, almost always provide a system for caching compiled templates in a binary file containing an intermediate code called bytecode.
This often considerably reduces CPU usage, especially when an intermediate code cache is added to the templating engine’s cache system.

To enable caching in Smarty:

<?php
require('Smarty.class.php');
$smarty = new Smarty;
$smarty->caching = 1;
$smarty->display('index.tpl');
?>
This best practice should only be applied if it is coherent with your project's specifications.
Under CC-By-NX-SA license