Reputation: 1260
I'm loading gzipped txt file after page load through ajax,
$(window).load(function(){
$.ajax({
url : "http://example.com/something.txt.gz",
dataType : 'html',
cache: true,
success : function(data)
{
data=$.parseJSON(data);
something=data;
}
});
});
And Based on chrome,
Accept-Ranges:bytes
Access-Control-Allow-Methods:GET
Access-Control-Allow-Origin:*
Access-Control-Max-Age:604800
Content-Encoding:gzip
Content-Length:95595
Content-Type:text/plain
Date:Wed, 21 May 2014 11:32:02 GMT
ETag:"cf999971e6ffcaf92dc5b79a8ffe2570k90bo"
Expires:Wed, 21 May 2014 23:40:18 GMT
Last-Modified:Wed, 21 May 2014 03:40:19 GMT
Server:AmazonS3
Vary:Origin, Access-Control-Request-Headers, Access-Control-Request-Method
x-amz-id-2:FGvjLrghp01FsNxaCI348RsP1BA+b98yjYzkkzpgeJNcz9HIn36CSfWIynkl18tfqNZp
x-amz-request-id:75FD682D733FDA0Ef3D
Now my problem is, This is working fine in chrome, FF, Safari and also IE9+.
But in IE8 and less than that the gzipped ajax is not working, if I send the same file using PHP then it works only by ajax it's not working and unzipped version of ajax call is also working.
Anyone please help me to fix this issue.
Thanks in advance.
Upvotes: 0
Views: 307
Reputation: 1260
Finally I found the issue. It was not with the gzipped content, it was a cross domain issue, IE has no issue with gzipped content.
IE 8 and less than that does't support cross domain ajax request even if I use sub-domain structure (like amazon s3). Here is my problem solution solution for my problem which I faced
Upvotes: 1