Marc Slagle wrote:

On Mon, 2003-09-08 at 11:51, Steve Hay wrote:


It also needs to have access to various static resources (images, stylesheets, JavaScript libraries etc.).

Thus, I want to have something like this:

/myproject [mp1]
/myproject/component1 [mp1]
/myproject/component2 [mp1]
...
/myproject/images [static]
/myproject/javascript [static]
/myproject/stylesheets [static]



You might want to look at having a translation handler.


As in a PerlTransHandler, yes?


We're doing something similar to this, where images and javascripts live under the same directory structure as the handler is managing. Instead of trying to configure this via that httpd.conf file, we chose to have a translation handler look at the incoming uri and determine whether the request is for a static file or for the code.

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.

Thanks for the code snippet, though - it looks pretty good to me aside from that concern.

- Steve



Reply via email to