mirror of
https://github.com/smarty-php/smarty.git
synced 2025-10-05 08:40:54 +02:00
68 lines
2.3 KiB
XML
68 lines
2.3 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision$ -->
|
|
<sect1 id="variable.cache.lifetime">
|
|
<title>$cache_lifetime</title>
|
|
<para>
|
|
This is the length of time in seconds that a template cache is valid.
|
|
Once this time has expired, the cache will be regenerated.
|
|
</para>
|
|
|
|
<itemizedlist>
|
|
<listitem><para>
|
|
<parameter>$caching</parameter> must be turned on (either 1 or 2) for
|
|
<parameter>$cache_lifetime</parameter> to have any purpose.
|
|
</para></listitem>
|
|
|
|
<listitem><para>
|
|
A value of -1 will force the cache to never expire.
|
|
</para></listitem>
|
|
|
|
<listitem><para>A value of 0 will cause
|
|
the cache to always regenerate (good for testing only, to disable caching
|
|
a more efficient method is to set <link
|
|
linkend="variable.caching"><parameter>$caching</parameter></link> = 0).
|
|
</para></listitem>
|
|
|
|
<listitem><para>
|
|
If you want to give certain templates their own cache lifetime, you could
|
|
do this by setting <link linkend="variable.caching">
|
|
<parameter>$caching</parameter></link> = 2,
|
|
then set <parameter>$cache_lifetime</parameter> to a unique value just
|
|
before calling <link linkend="api.display"><varname>display()</varname>
|
|
</link> or <link linkend="api.fetch"><varname>fetch()</varname></link>.
|
|
</para></listitem>
|
|
</itemizedlist>
|
|
|
|
<para>
|
|
If <link linkend="variable.force.compile">
|
|
<parameter>$force_compile</parameter></link> is
|
|
enabled, the cache files will be regenerated every time, effectively
|
|
disabling caching. You can clear all the cache files with the <link
|
|
linkend="api.clear.all.cache"><varname>clear_all_cache()</varname></link>
|
|
function, or individual cache files (or groups) with the <link
|
|
linkend="api.clear.cache"><varname>clear_cache()</varname></link> function.
|
|
</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
|
|
-->
|