Hello Marcin Kasperski, Tuesday, June 17, 2003, 3:13:23 AM, you wrote:
>> > sub handler { >> >> > my $r = shift; >> > my $uri = $r->uri; >> > ... detecting dynamic handlers ... >> > while( my($url, $dirs) = each %STATIC_FILES ) { >> > if( $uri =~ m{$url/(.*)$} ) { >> > foreach my $d (@$dirs) { >> > my $file = "$d/$1"; >> > if( -f $file ) { >> > $r->filename($file); >> > return OK; >> > } >> > } >> > } >> > } >> > } >> >> ah, a real-world example. Just what we need. Care to write a short pod >> section using this example, explaining the problem and the solution? >> plain text or pod will do. we will add it to the coding chapter. MK> Hmm, let's use my english-like language... MK> The problem: MK> - the application static files are installed in /myapp/img, MK> /myapp/css, ... MK> - local site customization can be made by installing customized files MK> in /custom/img, /custom/css... MK> - in both cases they are accessed via /img/..., /css/... urls MK> The solution - we use custom transhandler to check whether the MK> customized version exists and use it if so. In our setup we use mod_rewrite for things like that. It checks for static resources in the few places and if there is no custom version finally looks in the some standard location (images, css, javascripts, any static resources etc ...). In the dual frontend/backend setup I think this approach is better -- requests for static resources may still be served by light frontend server. -- WBR, Mike P. Mikhailov mailto: [EMAIL PROTECTED] ICQ: 280990142 Who is "General Failure", and what is he doing reading my hard disk ?