简体   繁体   中英

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

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 exhausted (tried to allocate 48 bytes)

I am looking for a way to compress the JSON.

Thanks

压缩JSON可能不会改变任何事情,因为在压缩JSON之前,您需要未压缩的JSON(即,最终将使用比当前使用的更多的内存)。

为什么不增加PHP.ini文件中的内存大小?

.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.

定期刷新输出缓冲区,因此您不需要多于几个KB即可生成许多MB流。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM