HtmlCompressorBundle
:warning: DEPRECATED:, (*1)
Unfortunately I want to inform this bundle is getting deprecated. Sorry for the inconvenience. :pensive:, (*2)
Allow to minify cacheable HTML and XML responses using htmlcompressor., (*3)
Installation
Get the bundle
Add this line in your composer.json require section:, (*4)
``` json
"vihuvac/htmlcompressor-bundle": "dev-master", (*5)
and run this command in your project directory:
``` bash
$ php composer.phar update vihuvac/htmlcompressor-bundle
Enable the bundle
Edit your application's kernel:, (*6)
``` php
// app/AppKernel.php, (*7)
<?php, (*8)
public function registerBundles()
{
$bundles = array(
// ...
new Vihuvac\Bundle\HtmlCompressorBundle\VihuvacHtmlCompressorBundle(),
);
}, (*9)
Now, it's time to configure it!
## Configuration
app/config/config.yml
html_compressor:
enabled: true
java: /usr/bin/java
jar: ~
options: {}
```, (*10)
|
Description |
Default value |
Exemple |
enabled |
determine if responses must be minified if they can |
true |
- |
java |
path to Java executable |
/usr/bin/java |
- |
jar |
path to htmlcompressor executable |
- |
%kernel.root_dir%/Resources/java/htmlcompressor-1.5.3.jar |
options |
any option described in the htmlcompressor documentation
|
- |
{ "--compress-js" : ~, "--compress-css" : ~, "--js-compressor" : closure, "--closure-opt-level" : simple } |