Enabling gzip compression in the IBM HTTP Server

来源:互联网 发布:薛之谦的淘宝店叫什么 编辑:程序博客网 时间:2024/05/29 16:34

To compress content before it is delivered to the client you can use Apache Module mod_deflate

 

To compress text/html text/plain text/xml text/css and js files in the IBM HTTP Server, add the below 2 lines to httpd.conf:

 LoadModule deflate_module modules/mod_deflate.so AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/javascript

and restart IBM HTTP Server.

 

To see what files a browser is getting as compressed, in Firefox, you can create a shortcut with this content as the link:

 javascript:(function(){function read(url){var r=new XMLHttpRequest();r.open('HEAD',url,false);r.send(null);return r.getAllResponseHeaders();}alert(read(window.location))})()

and it will easily print out the headers for whatever page you're on.

 

Otherwise, there are browser plugins for this specific purpose (livehttpheaders, web developer) and also command-line clients like wget -qS

 

There are samples at the top of this link to the Apache Module mod_deflate http://publib.boulder.ibm.com/httpserv/manual70/mod/mod_deflate.html

 

 

title image (modified) credit: (cc) Some rights reserved by buggi

 



Tags:  compress websphere gzip was ibm_http_server compression