mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-04 22:31:37 +01:00
84 lines
3.0 KiB
XML
84 lines
3.0 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision$ -->
|
|
<sect1 id="variable.caching">
|
|
<title>$caching</title>
|
|
<para>
|
|
This tells Smarty whether or not to cache the output of the templates
|
|
to the <link linkend="variable.cache.dir">
|
|
<parameter>$cache_dir</parameter></link>.
|
|
By default this is set to 0 ie disabled. If your templates generate
|
|
redundant content, it is advisable to turn on
|
|
<parameter>$caching</parameter>, as this will result in significant
|
|
performance gains.
|
|
</para>
|
|
|
|
<para>
|
|
You can also have
|
|
<link linkend="caching.multiple.caches">multiple</link>
|
|
caches for the same template.
|
|
</para>
|
|
|
|
<itemizedlist>
|
|
<listitem><para>
|
|
A value of 1 or 2 enables caching.
|
|
</para></listitem>
|
|
|
|
<listitem><para>
|
|
A value of 1 tells Smarty to use the current
|
|
<link linkend="variable.cache.lifetime"><parameter>$cache_lifetime</parameter></link>
|
|
variable to determine if the cache has expired.
|
|
</para></listitem>
|
|
<listitem><para>A value of 2 tells Smarty to use the
|
|
<link linkend="variable.cache.lifetime"><parameter>$cache_lifetime</parameter></link>
|
|
value at the time the cache was generated. This way you can set the
|
|
<link linkend="variable.cache.lifetime"> <parameter>$cache_lifetime</parameter></link>
|
|
just before <link linkend="api.fetch">fetching</link>
|
|
the template to have granular control over when that particular cache expires.
|
|
See also <link linkend="api.is.cached"><varname>is_cached()</varname></link>.
|
|
</para></listitem>
|
|
|
|
<listitem><para>
|
|
If <link linkend="variable.compile.check"><parameter>$compile_check</parameter></link>
|
|
is enabled, the cached content will be regenerated if
|
|
any of the templates or config files that are part of this cache are
|
|
changed.
|
|
</para></listitem>
|
|
<listitem><para>
|
|
If <link linkend="variable.force.compile">
|
|
<parameter>$force_compile</parameter></link> is enabled, the cached
|
|
content will always be regenerated.
|
|
</para></listitem>
|
|
</itemizedlist>
|
|
<para>
|
|
See also
|
|
<link linkend="variable.cache.dir"><parameter>$cache_dir</parameter></link>,
|
|
<link linkend="variable.cache.lifetime"><parameter>$cache_lifetime</parameter></link>,
|
|
<link linkend="variable.cache.handler.func"><parameter>$cache_handler_func</parameter></link>,
|
|
<link linkend="variable.cache.modified.check"><parameter>$cache_modified_check</parameter></link>,
|
|
<link linkend="api.is.cached"><varname>is_cached()</varname></link>
|
|
and the
|
|
<link linkend="caching">caching section</link>.
|
|
</para>
|
|
|
|
</sect1>
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|