Tuesday 13 May 2003 4:12:32 am
I have some questions about implementing caching. I've got my site fairly much done, but am noticing that I really need to figure out ways to improve the speed of the front page loads, as this page has to dig through all the content in the database in order to construct itself. I looked at the manual description of the cache-block function, but haven't figured out if i'm implementing it correctly, as i haven't seen any speed improvements (yes, i have turned on view caching in site.ini.php)
here's the code i'm using in the template:
20 most recent stories: <br>
{let test=fetch( 'content',
'list',
hash(parent_node_id, 158, class_filter_type, "include", class_filter_array, array(2), "sort_by", array("modified", false()), "depth", 0))
}
<table> {cache-block keys=$test}
{section name=Child loop=$test max=20}
<tr><td valign="top"><font size=-1>{$Child:item.data_map.article_date.data_int|l10n(date)}</td>
<td><font size=-1><a href={concat("/content/view/full/",$Child:item.node_id)|ezurl}>{attribute_view_gui attribute=$Child:item.data_map.pagetitle}</a>
<i>{attribute_view_gui attribute=$Child:item.data_map.article_location}</i></td></tr>{/cache-block}
{/section}
</table> {/let} have i used cache-block correctly? I guess the other question i have is how to move this into a {$module_result.content} output. The way the site is configured is to have a front page which has a listing of all the recent articles (and navigation to older pages) and link through to specific sections and articles which display by region. Basically a newswire which links through to a categorized news wire. I'm using two different templates to do this- one for the front page and one to display either the region or the individual article. Is there a way to specify a different format for {$module_result.content} for different templates, but using the same module?
you can see what i'm doing here: http://red.eggplantmedia.com/~fluoride/ez/index.php beware, the page loads slowly!
|