How to Compress JSON with ASP?

梦想的初衷 提交于 2020-01-10 04:20:07

问题


I have a large JSON data string that's 757KB. I tried GZIP'ing it, which successfully reduced file size down to 143KB. But, in it's GZIP'ed state, my JQUERY function can't make use of the compressed JSON data.

Any suggestions on how to compress JSON in an IIS/ASP environment and still be able to use the JSON data in a JQUERY function?


回答1:


Hope this helps:

  • Activate Dynamic Compression
  • Open SystemDir (C:\Windows\System32) and find this file: inetsvr\config\applicationhost.config
  • Find the <dynamicTypes> tag.
    Be sure you have <add mimeType="application/json" enabled="true" /> in the list.
  • Try reducing the amount of data you pass. 757KB is a LOT of information.
    If you pass HTML, you are doing it wrong. Pass the data and render it client side.
    If you are passing plain data, you are probably passing too much of it; try splitting it in more requests, in order to let the user show part of the whole information while still loading it.


来源:https://stackoverflow.com/questions/2515421/how-to-compress-json-with-asp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!