divendres, 15 de novembre de 2013

Compresió amb GZip al servidor

Si teniu una web allotjada a un servidor podeu aconseguir millores en el temps de càrrega de les pàgines. (no és el cas d'un blog com aquest a Blogger). Per exemple, incloent la compresió de continguts pel servidor. En un servidor APACHE es pot utilitzar el CODI següent al fitxer




# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddType x-font/otf .otf AddType x-font/ttf .ttf
AddType x-font/eot .eot AddType x-font/woff .woff
AddType image/x-icon .ico AddType image/png .png



Aquest codi es coloca al fitxer .htaccess
Llegiu l'article  http://softstribe.com/wordpress/enable-gzip-compression-in-wordpress
# compress text, html, javascript, css, xml: AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/xml AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE application/x-javascript AddType x-font/otf .otf AddType x-font/ttf .ttf AddType x-font/eot .eot AddType x-font/woff .woff AddType image/x-icon .ico AddType image/png .png
Read more at http://softstribe.com/wordpress/enable-gzip-compression-in-wordpress#l9WYQklgAK2uxwdy.99
# compress text, html, javascript, css, xml: AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/xml AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE application/x-javascript AddType x-font/otf .otf AddType x-font/ttf .ttf AddType x-font/eot .eot AddType x-font/woff .woff AddType image/x-icon .ico AddType image/png .png
Read more at http://softstribe.com/wordpress/enable-gzip-compression-in-wordpress#l9WYQklgAK2uxwdy.99