Click here to Skip to main content
15,890,845 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have set up an Apache server with PHP as a module in a Windows Server to develop an intranet site that will only be available for my company's LAN and I enabled HTTP Compression in the httpd.conf file. Some days ago I created a script that pulls a large CSV file from the web server using the XMLHttpRequest object and now that the HTTP compression is enabled at the web browser this runs great but only with Mozilla Firefox, the HTTP compression did not work in Internet Explorer as it gets the uncompressed content, I have ran several tests using IeHTTPheaders utility and also recording the getAllResponseHeaders() contents: the first thing I noticed is that getAllResponseHeaders() was not recording a 'Content-Encoding' header in Internet Explorer but it did record that header in Firefox, in short, Firefox works as expected but not IE. So far I am running the tests with IE 7 & 8 (we banished IE 6 long time ago) :laugh: and these same tests were ran in several machines at my company including my home computer via VPN, all of them with same results, even hardcoding the 'Accept-Encoding' header along with the request does not solve the issue.

This is the javascript code I am using to retrieve the CSV file, so far it only measures the time taken to retrieve the file contents and shows them to the user.
<pre>
ct=new Date();
start=ct.getHours() +':' +ct.getMinutes() + ':' +ct.getSeconds();
xmlObj = new XMLHttpRequest();

xmlObj.onreadystatechange = function(){

if(xmlObj.readyState == 4){
       ct=new Date();
       end=ct.getHours() +':' +ct.getMinutes() + ':'  +ct.getSeconds();
       alert('Ready! '+start+'. '+end);
       alert('Response from PHP: '+xmlObj.responseText);
       alert('Response from PHP: '+xmlObj.getAllResponseHeaders());//.responseText);
    }
}

xmlObj.open ('GET', 'pt.php', true);
xmlObj.send (null);




And this is the config options I set up on Apache to enable HTTP COmpression

AddOutputFilterByType DEFLATE text/html text/plain text/xml 


The web server is in my same network, I am not behind any proxy nor behind a firewall, also I disabled Antivirus software in both the server and the client machines without result... To me looks like this is a bug in the Internet Explorer implementation of XMLhttpRequest object since it works fine with Firefox.

Please help, I am seriously considering to cancel the project due this bug. :(( :(( :(( :(( :((
Posted

Go through following links, might help you..


http://www.webreference.com/internet/software/servers/http/compression/[^]

http://www.http-compression.com/[^]


Hope this will help!
 
Share this answer
 
use ActiveX.Object for the internet explorer for the ajax request.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900