Transparentnost použití příkazu cache
V obou případech bude výstup týž. Rozdíl je jen v efektivitě opakovaného vyhodnocování šablony.
Fragmenty kódu
Šablona s cache
{cache}
{while _primary!newsSource forceCount=1 limit=30}
{_.asset mode="newsOneliner"}
{whilelast}
<p>{xlat("news.total", null, _count)}</p>
{/whilelast}
{/while}
{/cache}
Šablona bez cache
{while _primary!newsSource forceCount=1 limit=30}
{_.asset mode="newsOneliner"}
{whilelast}
<p>{xlat("news.total", null, _count)}</p>
{/whilelast}
{/while}