Abadon
01-25-2010, 05:51 AM
Hello,
I have Apache running with two virtual hosts for my site. Today, as scratching marking the Internet I found this Firefox add-on - Page speed (http://code.google.com/intl/bg/speed/page-speed/) It showed me a very serious mistake. I have no compression on my page. I decided to put this through mod_deflate. (http://httpd.apache.org/docs/2.0/mod/mod_deflate.html) I read the documentation for this module and this page (http://httpd.apache.org/docs/2.0/mod/core.html#location) After that I've created the following configuration in /etc/apache2/mods-enabled/deflate.conf
<IfModule mod_deflate.c>
# AddOutputFilterByType DEFLATE text/html text/plain text/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
DeflateCompressionLevel 9
# SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.avi$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.mov$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.mp3$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.mp4$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.rm$ no-gzip dont-vary
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</IfModule>
Restart Apache and make test again. Results Page speed says:
Compressing the following resources with gzip could reduce their transfer size by 135.9KiB (71% reduction).
* Compressing http://sexkupon.com/static/jquery.js could save 38.1KiB (69% reduction).
* Compressing http://sexkupon.com/static/jquery.form.js could save 23.5KiB (73% reduction).
* Compressing http://sexkupon.com/static/jquery.dimensions.js could save 18.4KiB (78% reduction).
* Compressing http://sexkupon.com/$external_c/ds/%25%2510/101/10196301%25%25interface.style.css?4b445b88575fa could save 14.4KiB (77% reduction).
* Compressing http://sexkupon.com/static/interface.js could save 9.4KiB (72% reduction).
.......
.......
.......
Test here (http://www.gidnetwork.com/tools/gzip-test.php) tells me the following thing:
Web page compressed? Yes
Compression type? gzip
Size, Markup (bytes) 44,574
Size, Compressed (bytes) 7,734
Compression % 82.6
Response Headersstatus HTTP/1.1 200 OK
date Wed, 20 Jan 2010
14:23:32 GMT
server Apache
x-powered-by PHP/5.2.4-2ubuntu5.7
expires Thu, 19 Nov 1981
08:52:00 GMT
cache-control no-store, no-cache,
must-revalidate,
post-check=0,
pre-check=0
pragma no-cache
set-cookie PHPSESSID=6ef9c4b108
a1e86c377f341303d218
84; path=/
vary Accept-Encoding
content-encoding gzip
content-length 7734
connection close
content-type text/html;
charset=UTF-8
My question is who to believe? I have compression or not?
Thanks in advance!
I have Apache running with two virtual hosts for my site. Today, as scratching marking the Internet I found this Firefox add-on - Page speed (http://code.google.com/intl/bg/speed/page-speed/) It showed me a very serious mistake. I have no compression on my page. I decided to put this through mod_deflate. (http://httpd.apache.org/docs/2.0/mod/mod_deflate.html) I read the documentation for this module and this page (http://httpd.apache.org/docs/2.0/mod/core.html#location) After that I've created the following configuration in /etc/apache2/mods-enabled/deflate.conf
<IfModule mod_deflate.c>
# AddOutputFilterByType DEFLATE text/html text/plain text/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
DeflateCompressionLevel 9
# SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.avi$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.mov$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.mp3$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.mp4$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.rm$ no-gzip dont-vary
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</IfModule>
Restart Apache and make test again. Results Page speed says:
Compressing the following resources with gzip could reduce their transfer size by 135.9KiB (71% reduction).
* Compressing http://sexkupon.com/static/jquery.js could save 38.1KiB (69% reduction).
* Compressing http://sexkupon.com/static/jquery.form.js could save 23.5KiB (73% reduction).
* Compressing http://sexkupon.com/static/jquery.dimensions.js could save 18.4KiB (78% reduction).
* Compressing http://sexkupon.com/$external_c/ds/%25%2510/101/10196301%25%25interface.style.css?4b445b88575fa could save 14.4KiB (77% reduction).
* Compressing http://sexkupon.com/static/interface.js could save 9.4KiB (72% reduction).
.......
.......
.......
Test here (http://www.gidnetwork.com/tools/gzip-test.php) tells me the following thing:
Web page compressed? Yes
Compression type? gzip
Size, Markup (bytes) 44,574
Size, Compressed (bytes) 7,734
Compression % 82.6
Response Headersstatus HTTP/1.1 200 OK
date Wed, 20 Jan 2010
14:23:32 GMT
server Apache
x-powered-by PHP/5.2.4-2ubuntu5.7
expires Thu, 19 Nov 1981
08:52:00 GMT
cache-control no-store, no-cache,
must-revalidate,
post-check=0,
pre-check=0
pragma no-cache
set-cookie PHPSESSID=6ef9c4b108
a1e86c377f341303d218
84; path=/
vary Accept-Encoding
content-encoding gzip
content-length 7734
connection close
content-type text/html;
charset=UTF-8
My question is who to believe? I have compression or not?
Thanks in advance!
