You are here: Re: [SMARTY] display() and fetch() - a problem « Smarty Templates Posts « IT news, forums, messages
Re: [SMARTY] display() and fetch() - a problem

Posted by Boots on 09/30/25 11:13

Hi.

I believe the difference is that fetch() uses output buffering. An idea
that you can consider is to override display() in your custom smarty
class with something like:

function display($resource_name, $cache_id = null, $compile_id =
null)
{
echo $this->fetch($resource_name, $cache_id, $compile_id);
}

There is an old thread which may or may not be of interest:
http://marc.theaimsgroup.com/?l=smarty-dev&m=105223513623346&w=2

xo boots

--- Brian Jones <mojobojo@gmail.com> wrote:
> A page that has been developed in our environment takes on average
> 0.5
> seconds to load on our average desktop, including the display() call.
>
> Unfortunately, some of our users were experiencing up to 18 seconds
> load time. After replacing the display() call with fetch(), the
> trouble user load times came back down to reasonable levels.
>
> I wish I could say we have narrowed down what may have caused this,
> but the problem occurs randomly on Windows 2000 boxes, Windows XP
> boxes, and using either Firefox or Internet Explorer. It was
> consistant on the machine which had the problem regardless of the
> browser used. I would also like to note that the users have roaming
> profiles, and they logged into machines that seem to work and had no
> issues.
>
> Our server environment is IIS 6 on Windows 2003 Server, running PHP
> Version 4.3.10. The php.ini is stock in regards to any kind of
> values
> that specify timeouts/sizes/etc.
>
> The only difference made which appeared to fix the problem was again,
> switching a display() call to echoing out a fetch() call. I'd hate
> to
> end up having to rely on fetch() this whole time, especially because
> the default output from a stock Smarty install doesn't display
> debugging info (we hacked the code to include this for the time
> being).
>
> Does anyone have any ideas what may be going on here, and why
> display() is apparently hanging on random machines (yet
> consistantly)?
>
>
> Brian "bojo" Jones
>
> --
> the philosophy of bojo - http://www.mojobojo.com/
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация