Enable gzip on my account.

Status
Not open for further replies.

publicpack41

New Member
Messages
4
Reaction score
0
Points
0
I have tried several ways to enable gzip to compress my large html and php files but none seem to work. Is there something i need to enable or do in order for a file to be compressed and sent to the recipient?
 

Gouri

Community Paragon
Community Support
Messages
4,565
Reaction score
245
Points
63
I have tried several ways to enable gzip to compress my large html and php files but none seem to work. Is there something i need to enable or do in order for a file to be compressed and sent to the recipient?

Add this to your .htaccess
# compress the files
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/x-javascript
# removes some bugs
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent
 
Last edited:

callumacrae

not alex mac
Community Support
Messages
5,257
Reaction score
97
Points
48
Please note that enabling gzip will also mean you also use more resources. If you get suspended for high resource usage you should disable gzip again.

~Callum
 

publicpack41

New Member
Messages
4
Reaction score
0
Points
0
Hello

I tried the aforementioned method but after testing whether a gzip file is sent when querying my address I still get the normal html and php files. Maybe there is something with the server i am using 'chopin' which disables gzip.
 

callumacrae

not alex mac
Community Support
Messages
5,257
Reaction score
97
Points
48
Yes, you will still get the html and php files. What are you actually trying to do?

Enabling gzip will just make the files smaller.

~Callum
 

Gouri

Community Paragon
Community Support
Messages
4,565
Reaction score
245
Points
63
I have 4 100KB html files and they take long to load in the page and therefore i want them to be sent over to the end user compressed so it doesn't take long for the page to load. I tested the html files using http://www.gidnetwork.com/tools/gzip-test.php but it comes up as not compressed

The tool checks the php compressions

add this to your header file.

PHP:
<? ob_start("ob_gzhandler"); ?>

Then check
 
Status
Not open for further replies.
Top