Mind if I ask a nit-pick of a performance question?  Currently
speed and performance are of upmost importance (I'm currently involved in
a mod_perl vs JServ development race).  That being said, isn't pushing a
handler onto the request stack slower than predefining a handler that the
request falls through to?  I could be wrong and haven't tested things
otherwise, but, it would seem like pushing a custom handler (granted it's
already compiled into byte-code) onto the stack at the time of the request
would take slightly longer.  I suppose I'd be who of me to test this
assertion, but if you have any idea as to wether or not this case ahead of
time, I'd be greatly interested in hearing about your past experience.

        --Sean

-- 
Sean Chittenden                              <[EMAIL PROTECTED]>


On 12 Jan 2000, Randal L. Schwartz wrote:

> Date: 12 Jan 2000 07:33:36 -0800
> From: Randal L. Schwartz <[EMAIL PROTECTED]>
> To: Sean Chittenden <[EMAIL PROTECTED]>
> Cc: Etienne Pelaprat <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
> Subject: Re: problems with module at root of web site
> 
> >>>>> "Sean" == Sean Chittenden <[EMAIL PROTECTED]> writes:
> 
> Sean>         There are a few ways to go about this one, but here's the solution
> Sean> that I'd use.
> 
> Sean>         1)  Install a PerlTransHandler that sets the URI to / or whatever
> Sean> you want to have your PerlHandler work with.  Have the transhandler return
> Sean> DECLINED if $r->uri =~ m:^/images/:o;
> 
> Sean>         2)  Install a PerlHandler that builds the response for the web.
> 
> Or a variation of that, that I like... set up a TransHandler like this:
> 
>     sub handler { # PerlTransHandler
>       return DECLINED unless $r->uri eq "/";
>       $r->set_handler("perl-script");
>       $r->push_handlers( PerlHandler => sub {
>         ... your code goes here
>       }
>       return OK;
>     }
> 
> No need to mess with $r->uri, which will be very confusing if there's
> an error.
> 
> 
> Sean>         The advantage to doing it this way is:
> 
> Sean>         a)  this was what apache was designed for (multiple phases)
> Sean>         b)  allows other handlers to kick in before you build the response
> Sean> (such as mod_access)
> 
> Absolutely.
> 
> 

Reply via email to