How to save some bandwidth on webserver with deflate..?
my blog now having some sort of heavy usage due to multiple shared hosting package that i’m currently parked..

Found 380 domains hosted on the same web server as namran.net (210.48.152.20).

It appears that the web server located at 210.48.152.20 may be hosting one or more web sites with explicit content. The web sites in question are highlighted in red below. There is a possibility that all of the web sites on this web server may be blocked by web filtering software. Search engine rankings for these web sites may be affected as well.

not having a lot of money to throw in ( move to another package..)
so i have to stick around.. luckily got some optimization option could be done via cPanel itself..
and for mirroring part.. have to do it myself.. assume you had access to /etc/httpd/conf/httpd.conf

After being sometime referring to yahoo Yslow ..
one of the key component is to apply gzip function on css and javascript file..
which haven’t changed that much..

But if want to apply it on all html/text .. but not to images file..
I use the following httpd config..


<VirtualHost *:80>
ServerName blog.namran.net
DocumentRoot "/var/www/html/blog"
DirectoryIndex index.php
# Deflate
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
DeflateCompressionLevel 9
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
</VirtualHost>

and ..

<Directory "/var/www/html/blog">
# Insert filter
SetOutputFilter DEFLATE
# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
# BrowserMatch bMSIE !no-gzip !gzip-only-text/html
# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex won't work. You can use the following
# workaround to get the desired effect:
BrowserMatch bMSI[E] !no-gzip !gzip-only-text/html
# Don't compress images
SetEnvIfNoCase Request_URI
.(?:gif|jpe?g|png)$ no-gzip dont-vary
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
Order allow,deny
Allow from all
AllowOverride All
</Directory>

then have to restart the webserver to apply..

I think can also be applied with the .htaccess file though..

References :

1. http://developer.yahoo.com/yslow/faq.html
2. www.howtoforge.com/apache2_mod_deflate
3. http://www.yougetsignal.com/tools/web-sites-on-web-server/

p/s : small saving of bandwidth with something not so difficult to implement.. 8-)

Related posts:

  1. Implementing SSL into webserver
  2. Apache Tips : How to force redirect old domain to new domain
  3. Making www and @ point to the same servername in apache
  4. MRTG and SNMP setup
  5. Integrating Ubuntu boot config into CentOS 5.4 grub