Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

jquery - How to Compress JSON with ASP?

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Hope this helps:

  • Activate Dynamic Compression
  • Open SystemDir (C:WindowsSystem32) and find this file: inetsvrconfigapplicationhost.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.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...