Provide static gzip compression for css,js files via AsseticBundle
AsseticStaticGzipBundle is a bundle which creates gzipped versions of your css and js files.
It works transparently with AsseticBundle so you don't need to modify your code.
Nginx web server can compress response data on the fly. To save time it can be configured to send an already compressed copy of a file.
Saving CPU time.
Zip extension http://php.net/manual/en/zip.installation.php
PHP 5.3.3 and UP
php composer.phar require konstantin-kuklin/assetic-static-gzip-bundle
Add to your config file:
assetic_static_gzip: use: true level: 9
level can be 0-9 and provide level of gzip compression type. (where:
9 - best,
0 - without compression)
use enables or disables creating compression files
Add bundle to
Compression files will be creating with command:
php app/console assetic:dump
... 02:08:24 [file+] ...app/../web/css/794c670.css 02:08:24 [gzipped file+] ...app/../web/css/794c670.css.gz ...