Re: Performance question

From: Date: Thu, 18 Oct 2001 08:18:14 +0000
Subject: Re: Performance question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-71451@lists.php.net to get a copy of this message
> Hi! > > I have a page that uses server-side includes to display different > features. Something like this: > <html> > <!--#include virtual="feature1.php"--> (a few db calls) > <!--#include virtual="feature2.cgi"--> (perl-script with db calls) > <!--#include virtual="feature3.php"--> (even more db calls) > </html> > > If everything is embedded in a php-page I assume that the parser would > start only once, and that the db-connections would be open until the > whole page closes? > > If the assumption above is correct, does the same apply to a .shtml-page? > Or does the parser execute eache php-script one at the time, each time > invoking the parser? include virtual invokes an Apache sub-request. It is basically like sending another GET request back to Apache. It goes through all the same layers and the php or cgi script that is run sees it as a completely separate request. It has no idea it is part of a single .shtml page. So no, there can't be any sharing of resources across multiple include virtuals from a .shtml page. I would suggest doing the bulk in PHP and if you need a Perl cgi run, use PHP's virtual() function which does the same as include virtual in a .shtml page. -Rasmus

« previous php.general (#71451) next »