Reduce server response times (TTFB)

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1155
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Reduce server response times (TTFB)

Post by DIGI3 »

I think you'll still need to look at your nested LISE calls and see if there's a different way to do it. I'd probably look at doing multiple foreach loops in the same template, instead of calling LISE multiple times. LISE is rather inefficient at the moment (something JoMorg has added a workaround for in the next version, and I think plans to refactor completely in the future) so you want to use what's already loaded instead of loading the same information over and over.

I can't really walk you through it, I'd have to spend time on it myself to see what works best.
Not getting the answer you need? CMSMS support options
User avatar
Cyc
Forum Members
Forum Members
Posts: 81
Joined: Wed Nov 18, 2015 11:54 pm
Location: Poland

Re: Reduce server response times (TTFB)

Post by Cyc »

But I already use Your solutions:

Code: Select all

{if $items|@count > 0}

{assign var=products value=[]}

{foreach from=$items item=item}
  {$products[$item@index] = $item}
{/foreach}

{function name=product item=0 size=0 iteration=9}
  <li class="list-item list-item-{$iteration} list-item-{$size}{if !$item->fielddefs.thumb.value} no-image{/if} col">
    <a class="list-item-url row" {if !$item->fielddefs.more.value}href="{$item->url}" {/if}title="{$item->title}">
      {if $item->fielddefs.thumb.value}
      <figure class="list-item-figure col">
        <img loading="lazy" class="list-item-img"{if $item->fielddefs.thumbFit.value} style="object-position: {$item->fielddefs.thumbFit.value}px 50%;"{/if} src="uploads/images/products/{$item->fielddefs.thumb.value}" alt="{$item->title}">
      </figure>
      {/if}
      <h3 class="list-item-heading col"><span>{$item->title}</span></h3>
      <div class="list-item-footer col">
        <span class="list-item-more more">Czytaj dalej</span>
      </div>
    </a>
    <div class="listing-item listing-item-mobile{if !$item->fielddefs.thumb.value} no-image{/if} row">
      <div class="listing-item-content col">
        <h3 class="listing-item-heading heading-second">{if !$item->fielddefs.more.value}<a href="{$item->url}" title="{$item->title}">{/if}{$item->title}{if !$item->fielddefs.more.value}</a>{/if}</h3>
        {if $item->fielddefs.thumb.value}
        <figure class="listing-item-figure listing-item-figure-mobile">
          {if !$item->fielddefs.more.value}<a href="{$item->url}" title="{$item->title}">{/if}<img loading="lazy" class="listing-item-img"{if $item->fielddefs.thumbFit.value} style="object-position: {$item->fielddefs.thumbFit.value}px 50%;"{/if} src="uploads/images/products/{$item->fielddefs.thumb.value}" alt="{$item->title}">{if !$item->fielddefs.more.value}</a>{/if}
        </figure>
        {/if}
        {if $item->fielddefs.summary.value}
        <div class="listing-item-summary content">
          {$item->fielddefs.summary.value}
        </div>
        {/if}
        {if !$item->fielddefs.more.value}
          <a class="listing-item-url more" href="{$item->url}" title="{$item->title}">{if $item->fielddefs.moreText.value}{$item->fielddefs.moreText.value}{else}Zobacz produkt{/if}</a>
        {/if}
      </div>
      {if $item->fielddefs.thumb.value}
      <figure class="listing-item-figure col">
        {if !$item->fielddefs.more.value}<a href="{$item->url}" title="{$item->title}">{/if}<img class="listing-item-img"{if $item->fielddefs.thumbFit.value} style="object-position: {$item->fielddefs.thumbFit.value}px 50%;"{/if} src="uploads/images/products/{$item->fielddefs.thumb.value}" alt="{$item->title}">{if !$item->fielddefs.more.value}</a>{/if}
      </figure>
      {/if}
    </div>
  </li>
{/function}

  {assign var=index value=0}
  {foreach from=$products item=item}
  {if $item@first}<ul class="list-slide list-slide-first list-container row">{/if}
  {if $item@last || $item@iteration % 5 == 0}
    <li class="list-timer hidden">Timer</li>

    {for $iteration=$index * 3 to $index * 3 + 2}
      {if $products[$iteration]}{product item=$products[$iteration] size="small" iteration=$iteration + 1 - ($index * 3)}{/if}
    {/for}  

    {for $iteration=$index * 4 to $index * 4 + 3}
      {if $products[$iteration]}{product item=$products[$iteration] size="medium" iteration=$iteration + 1 - ($index * 4)}{/if}
    {/for}  

    {for $iteration=$index * 5 to $index * 5 + 4}
      {if $products[$iteration]}{product item=$products[$iteration] size="large" iteration=$iteration + 1 - ($index * 5)}{/if}
    {/for}  

    {assign var=index value=$index + 1}
    </ul>{if !$item@last}<ul class="list-slide list-container row">{/if}
  {/if}
  {/foreach}
{else}
<ul class="list-container no-item container row">
  <li class="list-timer hidden">Timer</li> 
  <li class="list-item no-image col">
    <div class="list-item-url row">
      <h3 class="list-item-heading col"><span>Brak wpisów w tej kategorii</span></h3>
    </div>
  </li>
</ul>
{/if}
I think problem exist because LISE module is not good enough optimized. Look at on simple products listing: http://airflo.compsoul.pl/produkty.html this subpage has 730 queries. So we have a at the homepage 6 LISE modules and 2000+ queries. There is nothing else I can do via CMS panel, I have to wait few years to update LISE or I have to change CMS to WP. Please make premium modules pack and support them.
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1155
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Reduce server response times (TTFB)

Post by DIGI3 »

the version of LISE with noprops is in beta, I don't think you'll need to wait years. You're welcome to sponsor (pay) JoMorg to make improvements sooner, I have done this in the past and he's very agreeable (in fact, I hired him to add the noprops parameter).

The Dev Team doesn't have the resources to create and support premium modules, we're a small team of volunteers. If CMSMS doesn't meet your needs you have the option to fork it, to write or hire someone to write modules for you, or, as you said, switch to a different CMS. We don't claim to be the perfect solution for all situations.
Not getting the answer you need? CMSMS support options
User avatar
Cyc
Forum Members
Forum Members
Posts: 81
Joined: Wed Nov 18, 2015 11:54 pm
Location: Poland

Re: Reduce server response times (TTFB)

Post by Cyc »

You don't have to support modules from "recommended list". But was be nice when modules will be updated on a regular basis. I understand that You are small company, but You never grows if You don't changing your business model. So thx for help and where can I support adding feature to LISE module? I keep my fingers crossed for your for Your success because my all company base on CMSMS.
Post Reply

Return to “CMSMS Core”