On Tue, 2003-09-09 at 05:00, Steve Hay wrote: > As in a PerlTransHandler, yes?
Yup. > Is there a performance penalty with this? You're using Perl code to > inspect the URI, and then handing control back to the Apache core if it > is a static file. I wanted to avoid requests for static files wasting > time by going to a Perl handler only to be returned to the Apache core > to serve the file, hence my LocationMatch override that catches requests > for static files. Static File: Devel::Timer Report -- Total time: 0.0006 secs Interval Time Percent ---------------------------------------------- 00 -> 01 0.0003 48.49% INIT -> Entering translation handler 01 -> 02 0.0002 36.91% Entering translation handler -> Checking to see if we are asking for a static file 02 -> 03 0.0001 14.60% Checking to see if we are asking for a static file -> This is a request for a static file, telling apache where it is Request we want to pass on to our handler: Devel::Timer Report -- Total time: 0.0005 secs Interval Time Percent ---------------------------------------------- 01 -> 02 0.0002 40.90% Entering translation handler -> Checking to see if we are asking for a static file 00 -> 01 0.0001 31.48% INIT -> Entering translation handler 02 -> 03 0.0001 27.62% Checking to see if we are asking for a static file -> This is not a request for a static file, returning DENIED We decided to do it this way because we are also doing some other things in the translation handler that I didn't pass along in the snippet. Since we were already putting a translation handler in place to do our trickery there, it seemed to make the most sense to us to add the code to handle static requests there. By no means am I suggesting that this is the "best" way, but we're pretty happy with it. Marc Slagle