I just discovered mod_perl's internal_redirect method. I was looking for
something like that for a routine that looks up some details and then
redirects to an image file.

>From benchmarking, it's only 2% slower than directly fetching the image
file, and 7% faster than using an external direct. Further, the result
produces a "Last-Modified" header based on the final image, which is
what I want, as it allows browser caching to work on the image.

The code is also rather simple:

        if ($ENV{MOD_PERL}) {
            my $r = Apache->request;
            $r->internal_redirect($url);
            use Apache::Constants 'OK';
            return OK;
        }
        else {
            $self->header_type('redirect');
            $self->header_props(
                -url => $url
            );
        }

However, I wanted to check with more experienced modperl/CGI::App users
about this approach. I think have short-circuited the CGI::App flow with
approach, preventing "teardown" from being called. That's OK in this
case, but is there another "Gotcha" here I missed?

   Mark


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[email protected]/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to