satya61229 Posted October 11, 2006 Share Posted October 11, 2006 Hello FriendsMy question is about usability of Ajax.I am a PHP developer.With PHP you can do http compression like gzip.I think you can do this with other scripting language also.Now my problem is compression does not work with Ajax. Reason is understandable.My query is how to use the compression technology with Ajax. [b]Is there is a way to decompress the content with js which was compressed with ob_start("ob_gzhandler");[/b]I tried to find out this on google, but lastly I have to post it here for my expert friend.Thanks & RegardsSatya Prakash Quote Link to comment https://forums.phpfreaks.com/topic/23665-ajax-and-decompression/ Share on other sites More sharing options...
ober Posted October 11, 2006 Share Posted October 11, 2006 Is there a reason you can't decompress it in the backend and then just pass the decompressed contents back to the page? Quote Link to comment https://forums.phpfreaks.com/topic/23665-ajax-and-decompression/#findComment-107429 Share on other sites More sharing options...
448191 Posted October 11, 2006 Share Posted October 11, 2006 [quote author=satya61229 link=topic=111200.msg450450#msg450450 date=1160574654]Now my problem is compression does not work with Ajax. Reason is understandable.[/quote]Like ober implied, gzip compression works fine on ajax requests. The browser will decompress anything that has an Encoding: Gzip header. Using ob_gzhandler as a callback for outputbuffering should include this HTTP header automaticly. Quote Link to comment https://forums.phpfreaks.com/topic/23665-ajax-and-decompression/#findComment-107486 Share on other sites More sharing options...
satya61229 Posted October 12, 2006 Author Share Posted October 12, 2006 [quote author=ober link=topic=111200.msg450465#msg450465 date=1160576398]Is there a reason you can't decompress it in the backend and then just pass the decompressed contents back to the page? [/quote]I want to use compression. Quote Link to comment https://forums.phpfreaks.com/topic/23665-ajax-and-decompression/#findComment-107796 Share on other sites More sharing options...
448191 Posted October 12, 2006 Share Posted October 12, 2006 [quote author=satya61229 link=topic=111200.msg450839#msg450839 date=1160639337]I want to use compression.[/quote]That we've established. Like I said, gzip works fine with ajax requests. Why do you say it doesn't work?[url=http://www.mnot.net/javascript/xmlhttprequest/]Here[/url]'s a link that tests XmlHttpRequest capabilities, you'll see that it supports Gzip on on at very least IE and FF. Quote Link to comment https://forums.phpfreaks.com/topic/23665-ajax-and-decompression/#findComment-107809 Share on other sites More sharing options...
satya61229 Posted October 12, 2006 Author Share Posted October 12, 2006 [quote author=448191 link=topic=111200.msg450853#msg450853 date=1160643744][quote author=satya61229 link=topic=111200.msg450839#msg450839 date=1160639337]I want to use compression.[/quote]That we've established. Like I said, gzip works fine with ajax requests. Why do you say it doesn't work?[url=http://www.mnot.net/javascript/xmlhttprequest/]Here[/url]'s a link that tests XmlHttpRequest capabilities, you'll see that it supports Gzip on on at very least IE and FF.[/quote]<hr>Thank you.Now I know I have to do something with Content-Coding when I want to use ob_start("ob_gzhandler");Thanks Quote Link to comment https://forums.phpfreaks.com/topic/23665-ajax-and-decompression/#findComment-107818 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.