AddOutputFilterByType
avuto gravi limitazioni in httpd-2.2
così è stato segnato lì disapprovato. Ma in httpd-2.4
questa direttiva è stata spostata su filter_module
, corretta e non deprecata.
in Apache 2.2 si dovrebbe invece consentire filter_module
e deflate_module
ed impiego:
# Declare a "gzip" filter, it should run after all internal filters like PHP or SSI
FilterDeclare gzip CONTENT_SET
# "gzip" filter can change "Content-Length", can not be used with range requests
FilterProtocol gzip change=yes;byteranges=no
# Enable "gzip" filter if "Content-Type" contains "text/html", "text/css" etc.
FilterProvider gzip DEFLATE resp=Content-Type $text/html
FilterProvider gzip DEFLATE resp=Content-Type $text/css
FilterProvider gzip DEFLATE resp=Content-Type $text/javascript
FilterProvider gzip DEFLATE resp=Content-Type $application/javascript
FilterProvider gzip DEFLATE resp=Content-Type $application/x-javascript
# Add "gzip" filter to the chain of filters
FilterChain gzip
deflate_module
servirebbe solo contenuti compressi per i browser che dichiarano il supporto per la codifica in gzip
richiesta di intestazione.
Questo mi ha aiutato bigtime. Solo un avviso su FilterProvider: https://github.com/h5bp/html5-boilerplate/issues/1012 – cgp
In Centos filter_module non è abilitato di default. Deve essere privo di commenti. –
Ciò ha provocato l'assenza casuale di ETags dalle risposte gzip. – Timothy003