Apache-Dynagzip
view release on metacpan or search on metacpan
Dynagzip.pm view on Meta::CPAN
}
sub chunkable { # call model: $var = chunkable($r);
# Check if the response could be chunked
#
my $r = shift;
my $result = undef;
# this is to downgrade to HTTP/1.0 for MSIE requests over SSL
# works in conjunction with this snippet from httpd.conf:
# SetEnvIf User-Agent ".*MSIE.*" \
# nokeepalive ssl-unclean-shutdown \
# downgrade-1.0 force-response-1.0
#
if ( $ENV{'downgrade-1.0'} or $ENV{'force-response-1.0'} ) {
$result = 0;
} elsif ($r->protocol =~ /http\/1\.(\d+)/io) {
# any HTTP/1.X is OK, just X==0 will be evaluated to FALSE in result
$result = $1;
}
return $result;
}
Dynagzip.pm view on Meta::CPAN
outgoing content that is dynamically generated on the fly by Perl and/or Java.
It is featured to serve the regular CGI binaries (C-written for examle)
as a standalong handler out of C<Apache::Filter> chain.
As an extra option, this handler can be used to compress dynamically the huge static
files, and to transfer gzipped content in the form of a stream back to the
client browser. For the last purpose C<Apache::Dynagzip> handler should be configured as
a standalong handler out of C<Apache::Filter> chain too.
Working over C<HTTP/1.0> this handler indicates the end of data stream by closing connection.
Indeed, over C<HTTP/1.1> the outgoing data is compressed within a chunked outgoing stream,
keeping the connection alive. Resonable control over the chunk-size is provided in this case.
In order to serve better the older web clients,
an C<extra light> compression is provided independently in order to remove
unnecessary leading blank spaces and/or blank lines
from the outgoing web content. This C<extra light> compression could be combined with
the main C<gzip> compression, when necessary.
The list of features of this handler includes:
=over 4
Dynagzip.pm view on Meta::CPAN
The second important point should be mentioned here: when user clicks the "Refresh" button, the
browser will reload the page from the server unconditionally. This is right behavior,
because it is exactly what the human user expects from "Refresh" button.
=over 4
=item Notes:
The lifetime defined by C<Expires> depends on accuracy of time settings on client machine.
If the client's local clock is running 1 hour back, the cached copy of
the page will be alive 60 minutes longer on that machine.
C<Apache::Dynagzip> never overwrites C<Expires> header set by earlier handler inside the filter-chain.
=back
=head2 Support for the Server-Side Cache
In order to support the Server-Side Cache
I place a reference to the dynamically generated document to the C<notes()>
when the Server-Side Cache Support is ordered.
( run in 2.097 seconds using v1.01-cache-2.11-cpan-df04353d9ac )