Hello ProcessWire community, as this is my first posting, I want to thank Ryan Cramer and the ProcessWire community for developing such a great software. ProcessWire is the first CMS that fits my needs perfectly and it's a pleasure to work with it. (Also thanks to isellsoap for recommending it to me.) So here's my first question: The website of a band has a kind of a diary. The children of "diary" have the template "tour" and the children of "tour" have the template "concert". "concert" has (beside others) a textarea field for the report, an image field for photos and a text field to embed a youtube video. None is required. An overview page should show a list of all concerts. If a field of the concert (report, photos, video) has content, a specific icon shall be shown. Everything works fine so far, but it takes about 5 seconds to render the page with about 250 concerts in the list. Currently I solve this by simply turn on the caching, but I think 5 seconds to list 250 pages is a bit too long. (What if I had to deal with 10000 pages or more?)
It runs on a virtual server with at least 1 GHz CPU and 2 Gbyte RAM.
Below is my code (a little shortened). Has somebody an idea, which could be the inefficient part?
Thank you in advance.
<ul>
<?php
foreach($tours->children as $tour) {
foreach($tour->children as $concert) { ?>
<li><?=$concert->date?>, <?=$concert->title?>, <?=$concert->city?>
<?php // Check for content, then show the icon
if($concert->text) { echo '<img src="'.$config->urls->templates.'styles/images/icon_text.png" alt="Konzertbericht" />'; }
if(count($concert->fotos) > 0) { echo '<img src="'.$config->urls->templates.'styles/images/icon_photos.png" alt="Fotos" />'; }
if($concert->podcast) { echo '<img src="'.$config->urls->templates.'styles/images/icon_video.png" alt="Podcast" />'; }
?>
</li>
<?php } // END foreach($tour->children as $concert) ?>
<?php } // END foreach($tours->children as $tour) ?>
</ul>