• Advertisement

Make your webpages faster with 80%

From well known Apache and IIS to any other web servers, you can find help, resources, tips and trick and news

Del.icio.us Digg FURL FaceBook Stumble Upon Reddit Google Bookmarks Squidoo Technorati Yahoo My Web

Make your webpages faster with 80%

Postby john » Sat Mar 14, 2009 9:37 pm

I hope you hear of Mod GZIP, no? If not, i'll explain to you what is all about: mod_deflate and mod_gzip are pretty the same thing, they are Apache web server components that compress any HTML, JS,CSS,TXT, or any other text based content before it sends to an user. For example, YourWeb LIFE's frontpage (http://www.yourweb-life.com) has 45KB (at the time this post has been creted), but just by adding 3 code lines to the .htaccess, it's now just 8KB, that's a big save, over 80%.

I'm going to provide you step by step tutorial of how you can simply make you site much more faster, you visitors more happy and cut down you bandwidth.

First, create (or open if it exists) the .htaccess file (in the root of your document) and add this 3 lines of code (anywhere):
Code: Select all
<FilesMatch "\.(js|html|css)$">
SetOutputFilter DEFLATE
</FilesMatch>


then save and upload this file ( it must be named exactl .htaccess and must be placed in the root of your document, where your main index.php/index.html file is)

We are using mod_deflate because there is a better compression technology (about 10-20% better than mod_gzip).
TROUBLESHOTING:
->if your getting a big 500 error on your website after adding this, that means that your Apache don't have this mode installed. Plaese see http://www.forum.yourweb-life.com/php-f73/gzip-pages-with-php-t141.htmlfor GZIP-ing with PHP.

If you want to use mod_gzip, please add this code instead:

Code: Select all
<Ifmodule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_can_negotiate Yes
mod_gzip_static_suffix .gz
AddEncoding gzip .gz
mod_gzip_update_static No
mod_gzip_command_version '/mod_gzip_status'
mod_gzip_keep_workfiles No

mod_gzip_minimum_file_size 500
mod_gzip_maximum_file_size 500000
mod_gzip_maximum_inmem_size 60000
mod_gzip_min_http 1000

mod_gzip_handle_methods GET POST

mod_gzip_item_exclude reqheader "User-agent: Mozilla/4.0[678]"
mod_gzip_item_exclude mime ^image/
mod_gzip_item_exclude file \.js$
mod_gzip_item_exclude file \.css$

mod_gzip_item_include file \.html$
mod_gzip_item_include file \.php$
mod_gzip_item_include file \.pl$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/html$
mod_gzip_item_include mime ^text/plain$
mod_gzip_item_include mime ^httpd/unix-directory$

mod_gzip_dechunk Yes
mod_gzip_add_header_count Yes
mod_gzip_send_vary On
</Ifmodule>
User avatar
john
New Member
New Member
 
Posts: 5
Joined: Sat Mar 14, 2009 8:49 pm
Gender: None specified

Advertisement

Return to Web Servers

Who is online

Users browsing this forum: No registered users and 0 guests

  • Advertisement