AW: [Catalyst] Compress HTML

Stefan catalyst at
Thu Sep 8 18:03:38 GMT 2011

Thanks Brian for the HTML::Packer link:

I've now tested to implement the packer for each template parsing by
modifying the process function in my Catalyst::View::TT

use HTML::Packer;

my $html_packer = HTML::Packer->init();

sub process {
	my ( $self, $c ) = @_;
	my $rendered = $self->render($c, $c->stash->{template});
	my $opts = { 
		remove_comments => 1,
		remove_newlines => 1,
		html5 => 1,
	$html_packer->minify( $rendered, $opts );
	$c->log->debug("Packed: " . $rendered);

But it seems that the html_packer has no effect, the debug output isn't

Did I something wrong? Is the $opts hashref correct?


More information about the Catalyst mailing list