Search code examples
phpsmartytemplate-engine

Smarty: what is the difference between templates_c and cache folder?


There are two folders - templates_c and cache that are used when using Smarty with caching.

I have enabled caching and after that, both contain some sort of cache (IMHO same files) but still with some php, not pure HTML. However, just curious what is the difference in those folders? Where Smarty looks first when trying to locate relative cache file?


Solution

  • templates_c used for compiled templates, but without the actual content, that can be dynamically inserted into them. On the other hand the cache folder is used for what you know as cached pages - the complete pages that served to user instead of re-compiling them each time.