开发者

How to compress JSON from PHP and decompress in ASP.NET

开发者 https://www.devze.com 2023-01-17 12:50 出处:网络
I am having a problem passing JSON from PHP server and ASP.NET server. I am getting Fatal error: Allowed memory size of 67108864 bytes exha开发者_运维问答usted (tried to allocate 48 bytes)

I am having a problem passing JSON from PHP server and ASP.NET server. I am getting Fatal error: Allowed memory size of 67108864 bytes exha开发者_运维问答usted (tried to allocate 48 bytes)

I am looking for a way to compress the JSON.

Thanks


Compressing the JSON will probably not change anything, since you'll need the uncompressed JSON before you can compress it (ie. you'll end up using even more memory then you are using currently).


Flush the output buffers regularly, so you don't need to have more than a few KB to produce your many MB stream.


Why not increase your memory size in your PHP.ini file?


.NET has built in compression classes. Such as the DeflateStream or GzipStream classes located in the System.IO.Compression namespace. They should do the trick.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号