[Jifty-commit] r4242 - in jifty/trunk:
lib/Jifty/Plugin/CompressedCSSandJS
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Mon Oct 15 08:33:08 EDT 2007
Author: jesse
Date: Mon Oct 15 08:33:06 2007
New Revision: 4242
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/Plugin/CompressedCSSandJS/Dispatcher.pm
Log:
r68131 at 70: jesse | 2007-10-15 13:29:26 +0100
* Cache gzipped output from the compressedcssandjs plugin
Modified: jifty/trunk/lib/Jifty/Plugin/CompressedCSSandJS/Dispatcher.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/CompressedCSSandJS/Dispatcher.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/CompressedCSSandJS/Dispatcher.pm Mon Oct 15 08:33:06 2007
@@ -18,6 +18,9 @@
use Jifty::Dispatcher -base;
+our($GZIP_CSS,$GZIP_JS);
+
+
on '/__jifty/js/*' => run {
my $arg = $1;
if ( $arg !~ /^[0-9a-f]{32}\.js$/ ) {
@@ -52,7 +55,10 @@
Jifty->handler->apache->header_out( "Content-Encoding" => "gzip" );
Jifty->handler->apache->send_http_header();
binmode STDOUT;
- print Compress::Zlib::memGzip( $ccjs->cached_javascript );
+
+
+ print $GZIP_JS ||= Compress::Zlib::memGzip( $ccjs->cached_javascript );
+
} else {
Jifty->log->debug("Sending squished JS");
Jifty->handler->apache->send_http_header();
@@ -91,7 +97,7 @@
Jifty->handler->apache->header_out( "Content-Encoding" => "gzip" );
Jifty->handler->apache->send_http_header();
binmode STDOUT;
- print Compress::Zlib::memGzip( Jifty->web->cached_css );
+ print $GZIP_CSS ||= Compress::Zlib::memGzip( Jifty->web->cached_css);
} else {
Jifty->log->debug("Sending squished CSS");
Jifty->handler->apache->send_http_header();
More information about the Jifty-commit
mailing list