Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Repository files navigation

HtmlCompressorBundle

Allow to minify cacheable HTML and XML responses using htmlcompressor.

Installation

Get the bundle

Add this line in your composer.json require section:

"matthecat/htmlcompressor-bundle": "dev-master"

and run this command in your project directory:

$ php composer.phar update matthecat/htmlcompressor-bundle

Enable the bundle

Edit your application's kernel:

<?php// app/AppKernel.phppublicfunctionregisterBundles()
{
$bundles = array(
// ...newMatTheCat\HtmlCompressorBundle\MatTheCatHtmlCompressorBundle(),
);
}

Now, it's time to configure it!

Configuration

# app/config/config.yml
html_compressor:
enabled: true
java: /usr/bin/java
jar: ~
options: {}
DescriptionDefault valueExemple
enableddetermine if responses must be minified if they cantrue-
javapath to Java executable/usr/bin/java-
jarpath to htmlcompressor executable-%kernel.root_dir%/Resources/java/htmlcompressor-1.5.3.jar
optionsany option described in the htmlcompressor documentation-{ '--compress-js': ~, '--js-compressor': closure }

About

Symfony2 bundle which allow to minify cacheable HTML and XML responses using htmlcompressor.

Resources

Stars

11 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages