I think the only conclusive answer is to try both and benchmark
them... there may be some generalizations one can make about memory,
hook/subroutine invocation overhead, etc., but ultimately you need to
test both methods to see which is faster. And please share your
findings if you decide to do t
Apparently i was not including the eos bucket in the new brigade.
It seems to work:
if ($b->is_eos) {
$this->my_function(\$f->ctx->{html},$f->r,$f->c);
#new bucket brigade to be filled with final modified bucket
my $nbb = APR::Brigade->new($f->c->pool,$f->c->bucket_alloc);
#new bucket, a uniqu
With the reading of Apache_Clean module (which i see is streamed-oriented) and
with ideas
of Ambrosino, i am with this:
sub handler : FilterRequestHandler {
my($f, $bb) = @_;
my $rv;
unless ($f->ctx) {
$f->r->headers_out->unset('Content-Length');
$f->ctx({html => ''});
}
while (!$bb->is_emp
Yikes indeed :)
I should have clarified that in our app we don't actually process
embedded tags. Our app lets users mangle the source HTML using RegEx,
and since users can (and often do) perform filtering like
s/()(.*?)(<\/body>)/$1$2<\/center>$3/, we need to buffer
it all.
The main benefit I se
Jeff Ambrosino wrote:
> The way to deal with this is to buffer as much content as you need
> (maybe the whole page) and then do your work on the buffer.
yikes!
> Our
> application (HTTP output filter) buffers the stream as we go and
> stores it on the filter context ($f->ctx) across filter inv
The way to deal with this is to buffer as much content as you need
(maybe the whole page) and then do your work on the buffer. Our
application (HTTP output filter) buffers the stream as we go and
stores it on the filter context ($f->ctx) across filter invocations.
When we've seen $f->eos, then we
I'm just changing my old "handler:FilterRequestHandler" in
PerlOutputFilterHandler as it
is not working with my "new&fresh"mp2 compilation.
Then there's the question. What i want is to parse html pageswith an output
filter that
take special tags (<%special%>)and insert there some specific conte