Ottimizzare il sito con htaccess


# OTTIMIZZAZIONE

# Comincia compressione

SetOutputFilter DEFLATE

AddOutputFilter DEFLATE text/plain

AddOutputFilter DEFLATE text/html

AddOutputFilter DEFLATE text/xml

AddOutputFilter DEFLATE text/css

AddOutputFilter DEFLATE application/xml

AddOutputFilter DEFLATE application/xhtml+xml

AddOutputFilter DEFLATE application/rss+xml

AddOutputFilter DEFLATE application/javascript

AddOutputFilter DEFLATE application/x-javascript

AddOutputFilter DEFLATE application/x-httpd-php

AddOutputFilter DEFLATE application/x-httpd-fastphp

AddOutputFilter DEFLATE image/svg+xml

BrowserMatch ^Mozilla/4 gzip-only-text/html

BrowserMatch ^Mozilla/4.0[678] no-gzip

BrowserMatch bMSIE !no-gzip !gzip-only-text/html

SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0

# Don't compress images

SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary

 

AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css

<FilesMatch ".(js|css|html|htm|php|xml)$">

SetOutputFilter DEFLATE

</FilesMatch>