PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.smarty.general > Controling buffer: php/smarty or apache?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Controling buffer: php/smarty or apache?

Réponse
 
LinkBack Outils de la discussion
Vieux 23/01/2006, 09h39   #1 (permalink)
robert mena
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Controling buffer: php/smarty or apache?

Hi,

I am facing a strange problem. My site, even tough designed to appear
quickly at user's browser, appears at "once". If I test the static HTML
version it starts to appear as downloaded If I test the php generated
version the page seems render as a whole.

I am using smarty as a template and it seems to be related to a buffer
somewhere: php/smarty or apache.

I've used microtime and from the begin of the php script until after the
smarty->display it takes from 0.05s (min) to 0.32s (max)

Any tips of how can I figure out what is "slowing" down my site?

tks

  Réponse avec citation
Vieux 23/01/2006, 09h53   #2 (permalink)
Vicente Werner
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [SMARTY] Controling buffer: php/smarty or apache?

Smarty buffers all the output until you do a $smarty->display or you echo
the fetched output through $smarty->fetch. That's why it appears to be drawn
at once.
One thing you can do it's to slice the page into three or four objects that
can be rendered incrementally (you render the header and display it, then go
for the body, footer, etc..)

--
Vicente Werner y Sánchez
  Réponse avec citation
Vieux 23/01/2006, 10h06   #3 (permalink)
messju mohr
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [SMARTY] Controling buffer: php/smarty or apache?

On Mon, Jan 23, 2006 at 05:39:57AM -0400, robert mena wrote:
> Hi,
>
> I am facing a strange problem. My site, even tough designed to appear
> quickly at user's browser, appears at "once". If I test the static HTML
> version it starts to appear as downloaded If I test the php generated
> version the page seems render as a whole.
>
> I am using smarty as a template and it seems to be related to a buffer
> somewhere: php/smarty or apache.
>
> I've used microtime and from the begin of the php script until after the
> smarty->display it takes from 0.05s (min) to 0.32s (max)
>
> Any tips of how can I figure out what is "slowing" down my site?


first read: http://php.net/outcontrol

> tks

  Réponse avec citation
Vieux 23/01/2006, 10h07   #4 (permalink)
messju mohr
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [SMARTY] Controling buffer: php/smarty or apache?

On Mon, Jan 23, 2006 at 10:53:04AM +0100, Vicente Werner wrote:
> Smarty buffers all the output until you do a $smarty->display or you echo
> the fetched output through $smarty->fetch. That's why it appears to be drawn
> at once.


wrong. smarty doesn't buffer anything with display().

> One thing you can do it's to slice the page into three or four objects that
> can be rendered incrementally (you render the header and display it, then go
> for the body, footer, etc..)
>
> --
> Vicente Werner y Sánchez

  Réponse avec citation
Vieux 23/01/2006, 10h13   #5 (permalink)
robert mena
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [SMARTY] Controling buffer: php/smarty or apache?

Hi Vicente,

Thanks for the reply.

I suppose you mean having separate tpls for the segments of the page and
calling smarty->display several times for each tpl?

Is there any other way such as a flag in smarty to disable this buffer? I
am assuming that smarty does ob_start at the beginning of the execution.

tks,


On 1/23/06, Vicente Werner <vwerner@gmail.com> wrote:
>
> Smarty buffers all the output until you do a $smarty->display or you echo
> the fetched output through $smarty->fetch. That's why it appears to be
> drawn
> at once.
> One thing you can do it's to slice the page into three or four objects
> that
> can be rendered incrementally (you render the header and display it, then
> go
> for the body, footer, etc..)
>
> --
> Vicente Werner y Sánchez
>


  Réponse avec citation
Vieux 23/01/2006, 11h00   #6 (permalink)
messju mohr
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [SMARTY] Controling buffer: php/smarty or apache?

On Mon, Jan 23, 2006 at 06:13:35AM -0400, robert mena wrote:
> Hi Vicente,
>
> Thanks for the reply.
>
> I suppose you mean having separate tpls for the segments of the page and
> calling smarty->display several times for each tpl?


no. just turn off output-buffering in php (see my other post).

> Is there any other way such as a flag in smarty to disable this buffer? I
> am assuming that smarty does ob_start at the beginning of the execution.


no, it doesn't. (see my other post).

> tks,
>
>
> On 1/23/06, Vicente Werner <vwerner@gmail.com> wrote:
> >
> > Smarty buffers all the output until you do a $smarty->display or you echo
> > the fetched output through $smarty->fetch. That's why it appears to be
> > drawn
> > at once.
> > One thing you can do it's to slice the page into three or four objects
> > that
> > can be rendered incrementally (you render the header and display it, then
> > go
> > for the body, footer, etc..)
> >
> > --
> > Vicente Werner y Sánchez
> >

  Réponse avec citation
Vieux 23/01/2006, 11h09   #7 (permalink)
Vicente Werner
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [SMARTY] Controling buffer: php/smarty or apache?

I stand corrected that smarty per se dosn't buffer.

I understand though that he's facing the problem that he put everything
inside a template so until he does a fetch or display, he dosn't get any
output. Thus the best way to get somewhat of incremental rendering is to
partition the full template into some subtemplates that render
incrementally. You can see something like that at www.dinahosting.com (uses
smarty) that does full use of hierarchical rendering with some parts being
incrementally rendered

On 23/01/06, messju mohr <messju@lammfellpuschen.de> wrote:
>
> On Mon, Jan 23, 2006 at 06:13:35AM -0400, robert mena wrote:
> > Hi Vicente,
> >
> > Thanks for the reply.
> >
> > I suppose you mean having separate tpls for the segments of the page and
> > calling smarty->display several times for each tpl?

>
> no. just turn off output-buffering in php (see my other post).
>
> > Is there any other way such as a flag in smarty to disable this

> buffer? I
> > am assuming that smarty does ob_start at the beginning of the execution.

>
> no, it doesn't. (see my other post).
>
> > tks,
> >
> >
> > On 1/23/06, Vicente Werner <vwerner@gmail.com> wrote:
> > >
> > > Smarty buffers all the output until you do a $smarty->display or you

> echo
> > > the fetched output through $smarty->fetch. That's why it appears to be
> > > drawn
> > > at once.
> > > One thing you can do it's to slice the page into three or four objects
> > > that
> > > can be rendered incrementally (you render the header and display it,

> then
> > > go
> > > for the body, footer, etc..)
> > >
> > > --
> > > Vicente Werner y Sánchez
> > >

>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



--
Vicente Werner y Sánchez
  Réponse avec citation
Vieux 23/01/2006, 13h02   #8 (permalink)
robert mena
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [SMARTY] Controling buffer: php/smarty or apache?

Hi Messju,

I've read already.

Here are my settings:
implicit_flush Off
output_buffering *no value*
output_handler *no value*



On 1/23/06, messju mohr <messju@lammfellpuschen.de> wrote:
>
> On Mon, Jan 23, 2006 at 05:39:57AM -0400, robert mena wrote:
> > Hi,
> >
> > I am facing a strange problem. My site, even tough designed to appear
> > quickly at user's browser, appears at "once". If I test the static HTML
> > version it starts to appear as downloaded If I test the php generated
> > version the page seems render as a whole.
> >
> > I am using smarty as a template and it seems to be related to a buffer
> > somewhere: php/smarty or apache.
> >
> > I've used microtime and from the begin of the php script until after the
> > smarty->display it takes from 0.05s (min) to 0.32s (max)
> >
> > Any tips of how can I figure out what is "slowing" down my site?

>
> first read: http://php.net/outcontrol
>
> > tks

>


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 03h51.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,13505 seconds with 16 queries