With Apache 1.3, mod_perl 1.21
How can I gererate multiple pages returned from one request? I don't see
how to create the multi-part return, when the data comes from multiple
static files:
eg.
request : www.mysite.com/userdir/index.html When this request comes in and
based on some settings in the authen-db, we need to generate not only the
data from index.html, but also send the file www.mysite.com/core/info.html
which would be opened in another window.
And to make things worse - even though I called index.html in my exaple, I
really need to trigger the second file whenever "ANY" request comes in to
the users directory. This means it may be a static file, a directory
listing, or dynamic info created by a module. The last of which is my main
problem. I am trying to do this without doing a sepate lwp-request, pulling
into a local array and resending -
If this is my only way then is it worth it? Wouldn't the performance hit be
quite high? 80-90% of the users would require this second page. Are there
a better approach?
I have found the CGI::Push::do_push, but this only works for dynamic data,
or data in a local @array. Is there a way to tie Apache to CGI::Push, and
let me pass in a uri? Or have one leg do a lookup_uri($user_request_uri);,
and the other do a static $r->lookup("/file.html"); ?
do_push(-next_page => \&main_request,
-last_page => \&secondary_page,
-delay => 0.0,
);
sub main_page {
my($q,$counter) = @_; # $q, $counter are
passed in automagically
return undef if $counter >= 2; # second time
through it terminates the loop
return $r->lookup_uri($user_request_uri);
}
sub secondary_page {
my($q,$counter) = @_;
return $r->lookup_file("/some_file.html");
}
TIA -