cvs: smarty /docs/en/programmers/caching caching-cacheable.xml
"Mehdi Achour" <[email protected]>
| Newsgroups | gmane.comp.php.cvs.smarty |
|---|---|
| Message-ID | <cvsdidou1081857749@cvsserver> |
didou Tue Apr 13 08:02:29 2004 EDT
Modified files:
/smarty/docs/en/programmers/caching caching-cacheable.xml
Log:
WS
http://cvs.php.net/diff.php/smarty/docs/en/programmers/caching/caching-cacheable.xml?r1=1.1&r2=1.2&ty=u
Index: smarty/docs/en/programmers/caching/caching-cacheable.xml
diff -u smarty/docs/en/programmers/caching/caching-cacheable.xml:1.1 smarty/docs/en/programmers/caching/caching-cacheable.xml:1.2
--- smarty/docs/en/programmers/caching/caching-cacheable.xml:1.1 Tue Apr 13 07:39:16 2004
+++ smarty/docs/en/programmers/caching/caching-cacheable.xml Tue Apr 13 08:02:28 2004
@@ -1,26 +1,35 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.1 $ -->
- <sect1 id="caching.cacheable">
- <title>Controlling Cacheability of Plugins' Output</title>
- <para>
-Since Smarty-2.6.0 plugins the cacheability of plugins can be declared
-when registering them. The third parameter to register_block,
-register_compiler_function and register_function is called
-<parameter>$cacheable</parameter> and defaults to true which is also
-the behaviour of plugins in Smarty versions before 2.6.0
- </para>
-
- <para>
-When registering a plugin with $cacheable=false the plugin is called everytime the page is displayed, even if the page comes from the cache. The plugin function behaves a little like an <link linkend="plugins.inserts">insert</link> function.
- </para>
-
- <para>
-In contrast to <link linkend="language.function.insert">{insert}</link> the attributes to the plugins are not cached by default. They can be declared to be cached with the fourth parameter <parameter>$cache_attrs</parameter>. <parameter>$cache_attrs</parameter> is an array of attribute-names that should be cached, so the plugin-function get value as it was the time the page was written to cache everytime it is fetched from the cache.
- </para>
-
- <example>
- <title>Preventing a plugin's output from being cached</title>
- <programlisting role="php">
+<!-- $Revision: 1.2 $ -->
+ <sect1 id="caching.cacheable">
+ <title>Controlling Cacheability of Plugins' Output</title>
+ <para>
+ Since Smarty-2.6.0 plugins the cacheability of plugins can be declared
+ when registering them. The third parameter to register_block,
+ register_compiler_function and register_function is called
+ <parameter>$cacheable</parameter> and defaults to true which is also
+ the behaviour of plugins in Smarty versions before 2.6.0
+ </para>
+
+ <para>
+ When registering a plugin with $cacheable=false the plugin is
+ called everytime the page is displayed, even if the page comes
+ from the cache. The plugin function behaves a little like an
+ <link linkend="plugins.inserts">insert</link> function.
+ </para>
+
+ <para>
+ In contrast to <link linkend="language.function.insert">{insert}</link>
+ the attributes to the plugins are not cached by default. They can be
+ declared to be cached with the fourth parameter
+ <parameter>$cache_attrs</parameter>. <parameter>$cache_attrs</parameter>
+ is an array of attribute-names that should be cached, so the
+ plugin-function get value as it was the time the page was written
+ to cache everytime it is fetched from the cache.
+ </para>
+
+ <example>
+ <title>Preventing a plugin's output from being cached</title>
+ <programlisting role="php">
<![CDATA[
index.php:
@@ -52,16 +61,19 @@
Time Remaining: {remain endtime=$obj->endtime}
]]>
-</programlisting>
- <para>
-The number of seconds till the endtime of $obj is reached changes on each display of the page, even if the page is cached. Since the endtime attribute is cached the object only has to be pulled from the database when page is written to the cache but not on subsequent requests of the page.
- </para>
- </example>
-
-
- <example>
- <title>Preventing a whole passage of a template from being cached</title>
- <programlisting role="php">
+ </programlisting>
+ <para>
+ The number of seconds till the endtime of $obj is reached changes on
+ each display of the page, even if the page is cached. Since the
+ endtime attribute is cached the object only has to be pulled from the
+ database when page is written to the cache but not on subsequent requests
+ of the page.
+ </para>
+ </example>
+
+ <example>
+ <title>Preventing a whole passage of a template from being cached</title>
+ <programlisting role="php">
<![CDATA[
index.php:
@@ -91,13 +103,18 @@
{/dynamic}
]]>
-</programlisting>
-
- </example>
- <para>
-When reloading the page you will notice that both dates differ. One is "dynamic" one is "static". You can do everything between {dynamic}...{/dynamic} and be sure it will not be cached like the rest of the page.
- </para>
-</sect1>
+ </programlisting>
+ </example>
+
+ <para>
+ When reloading the page you will notice that both dates differ. One
+ is "dynamic" one is "static". You can do everything between
+ {dynamic}...{/dynamic} and be sure it will not be cached like the rest
+ of the page.
+ </para>
+
+ </sect1>
+
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
@@ -117,4 +134,4 @@
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
--->
\ No newline at end of file
+-->
--
Smarty CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php