views:

46

answers:

1

Hi guys I want to speed up my ajax requests, I'm returning large amounts of information from the requests and was wondering if any sort of compression could be applied here to speed things up a bit.

My ajax requests typically all send in JSON encoded objects such as objects and arrays which contain html elements and other stuff at times. My server sided code is php and I'm using the sajax library. Any ideas to speed things up would be greatly appreciated

+1  A: 

Yes, just enable the zlib.output_compression config in you php.ini. If the client sends the Accept-Encoding header containing gzip, then the output is automatically gzipped and sent to the client.

Another option is to do it by manually calling the ob_gzhandler function.

Anurag