Hy can anyone that is using gzip for html js php and css how to implement this on a server.

What I want to know is :

  1. What do I have do write in .htacces 2.What and from where to download
  2. most important does it make a diferance and does it pay off.

Thx for your help and time

Comments

apache 1.3 or 2.x?

Written by galambalazs

Accepted Answer

You need mod_deflate or mod_gzip to be enabled on your httpd.conf. After that, you should put the following lines into your configuration or .htaccess file.

Apache 1.3.x:

mod_gzip_on Yes  

mod_gzip_item_include mime ^application/x-javascript$  
mod_gzip_item_include mime ^application/json$  
mod_gzip_item_include mime ^text/.*$  

mod_gzip_item_include file \.html$  
mod_gzip_item_include file \.php$  
mod_gzip_item_include file \.js$  
mod_gzip_item_include file \.css$  
mod_gzip_item_include file \.txt$  
mod_gzip_item_include file \.xml$  
mod_gzip_item_include file \.json$  

Header append Vary Accept-Encoding

Apache 2.0

AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-javascript application/json   
Header append Vary Accept-Encoding
Written by galambalazs
This page was build to provide you fast access to the question and the direct accepted answer.
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki