Best way to compress the HTTP?

purpler

New Member
Messages
13
Reaction score
0
Points
0
Hi, i need to know hat is the best way to compress the HTTP traffic via .htaccess.
I tried:


Code:
php_flag zlib.output_compression On
- Gives me Error 500

Code:
php_value zlib.output_compression  On
- Gives me Error 500

Code:
<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
- Seems to not work, tested with several online gzip check services.

Code:
SetOutputFilter DEFLATE
- Seems to not work

Only thing that worked is to handle all HTML files by PHP:

#put this in .htaccess
Code:
AddHandler application/x-httpd-php5 .html

#put this before any code in every HTML page:
Code:
<?php ob_start( 'ob_gzhandler' );?>

Please help me and clear up a bit what is the best working solution here at x10hosting.com and generally!
Thanks in advance!
 

Zubair

Community Leader
Community Support
Messages
8,766
Reaction score
305
Points
83
***Moved to Programming Help***
 

purpler

New Member
Messages
13
Reaction score
0
Points
0
thanks for your suggestions but if you read the entire post i wrote you'd see that i already tried that method and that it doesn't worked.
Anyways, i found the way to compress the traffic without using .htaccess.
Thanks for good will anyways!
 

b3n199

New Member
Messages
21
Reaction score
0
Points
0
could you share how to compress site without rewrite .htaccess file?
 
Top