Improve loading time of page items - Joomla! Forum - community, help and support
hi, need improve loading time of properties listed on real estate component.
if user has between 50 , 100 properties page loads fine, if user has hundreds or thousands properties page freezes until the total properties loaded.
the listing of properties done through "foreach" php loop, using code below one. when total properties listed significant, loop tales 20 seconds finish listing properties.
how can speed process?
maybe lazy load each "div" container? haven't found way lazy load chunks of code... images, , didn't speed page.
thanks!!!
if user has between 50 , 100 properties page loads fine, if user has hundreds or thousands properties page freezes until the total properties loaded.
the listing of properties done through "foreach" php loop, using code below one. when total properties listed significant, loop tales 20 seconds finish listing properties.
how can speed process?
maybe lazy load each "div" container? haven't found way lazy load chunks of code... images, , didn't speed page.
thanks!!!
code: select all
<?php foreach ($this->items $key=>$item):
if(isset($this->images[$item->id])) $images = $this->images[$item->id]; else $images = false;
$number = ($key+1)+jrequest::getint('limitstart');
?>
<div id="container">
<div id="primary"><a id="itemjc<?=$number?>"></a>
<?= jhtml::_('image', $images, 'img', '') ?>
</div>
<div id="content">
<?= jhtml::_('link', $link, $item->title, 'class="grid-item-title"') ?>
<?=$number?>
<?=$item->category_title?>
</div>
<?php endforeach; ?>
you need make load x amount, , paginate it. loads x amount per page.
Comments
Post a Comment