You can set it in display.
$ Smarty-> display ("demo. TPL", $ _ server [request_uri]) to implement a template with multiple caches.
Now that the file has been cached, we can go through the cached file and connect to the database without repeating the execution. Judge using a function in smatry
$ Smarty-> iscached (Demo. TPL "", ", $ _ server [request_uri]) The default value is" true ". The template here must be the same as the display template.
There is a difference between smarty3 and smarty2.
$ Smarty-> is_cached (Demo. TPL "", ", $ _ server [request_uri]) smarty2
$ Smarty-> iscached (Demo. TPL "", ", $ _ server [request_ur] I) smarty3
However, some templates do not need to be cached, for example, user login, andArticleThe comments do not need to be cached.
1. In the PHP file, data that does not need to be cached must be placed beyond the iscached judgment.
2. If no cache is required in the template, place it between <{nocache}> ...... <{/nocache}>.