Habilitar el mod_deflate en CentOS 6.2

Entramos a la consola y escribimos:
nano /etc/httpd/conf/httpd.conf

Agregamos en la última línea:
# Compresion
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/javascript application/x-javascript text/javascript

Reiniciamos apache2. Entramos en la consola y escribimos:
service httpd restart

Ahora hacemos pruebas para comprobar si se usa la compresión.
Sin compresión
root@debianEstable:~$ wget -S http://192.168.1.153/phpinfo.php
--2012-05-16 10:45:51--  http://192.168.1.153/phpinfo.php
Connecting to 192.168.1.153:80... conectado.
Petición HTTP enviada, esperando respuesta...
HTTP/1.1 200 OK
Date: Wed, 16 May 2012 14:44:55 GMT
Server: Apache/2.2.15 (CentOS)
X-Powered-By: PHP/5.3.3
Vary: Accept-Encoding
Connection: close
Content-Type: text/html; charset=utf-8
Longitud: no especificado [text/html]
Saving to: `phpinfo.php.4'

[ <=>                                                                                                                                                                                            ] 45.152      –.-K/s   in 0,007s

2012-05-16 10:45:51 (5,79 MB/s) – `phpinfo.php.4′ saved [45152]

Con compresión:
root@debianEstable:~$ wget -S --header="Accept-Encoding: gzip,deflate"  http://192.168.1.153/phpinfo.php
--2012-05-16 10:45:56--  http://192.168.1.153/phpinfo.php
Connecting to 192.168.1.153:80... conectado.
Petición HTTP enviada, esperando respuesta...
HTTP/1.1 200 OK
Date: Wed, 16 May 2012 14:45:00 GMT
Server: Apache/2.2.15 (CentOS)
X-Powered-By: PHP/5.3.3
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 8396
Connection: close
Content-Type: text/html; charset=utf-8
Longitud: 8396 (8,2K) [text/html]
Saving to: `phpinfo.php.5'

100%[==================================================================>] 8.396       –.-K/s   in 0,005s

2012-05-16 10:45:56 (1,56 MB/s) – `phpinfo.php.5′ saved [8396/8396]

OBS:
Pueden ver como se reduce mucho el sitio usando compresión, así que les recomiendo a que lo usen.

(Visited 224 times, 1 visits today)

Comments

comments


Post Relacionados

Be the first to comment

Leave a Reply

Tu dirección de correo no será publicada.


*