compiling vs. caching
| From: | Eric Ocean | Date: | Fri, 18 Apr 2003 22:50:13 +0000 |
| Subject: | compiling vs. caching | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-9329@lists.php.net to get a copy of this message | ||
There is a difference between these two things, isn't there?
My understanding (please correct me if I'm wrong) is that template compiling makes it faster for Smarty, the object, to read in a template. It does not affect, in any way, the output from the template.
Template caching, on the other hand, caches the output from evaluating the template at a particular point in time. Since subsequent evaluations of the template will actually just return the output from the cached evaluation, the content returned could be "stale". It is up to the user to determine how stale is too stale.
The insert function allows you to have dynamic content even when template caching is turned on. Thus it's a way to get the benefits of template caching for all of your static content, while still retaining the ability to generate some things dynamically on each page load.
Thanks,
Eric Ocean