Ajax request acceleration - can gzip compression be applied?

Hi guys, I want to speed up my ajax requests, I am returning a large amount of information from the requests and am wondering if any compression can be applied here to speed things up a bit.

My ajax requests usually send to JSON-encoded objects, such as objects and arrays that sometimes contain html elements and other things. My server code is php and I am using the sajax library. Any ideas to speed things up would be greatly appreciated.

+6
json javascript ajax php compression
source share
1 answer

Yes, just enable zlib.output_compression . If the client sends an Accept-Encoding header containing gzip , it is automatically downloaded and sent to the client.

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

+7
source share

All Articles