Long HTML Ajax String
I am开发者_StackOverflow中文版 sending a long string (of html) to a browser via ajax. What are my options to make the client download process take less time?
You can just sending a value via JSON not full of rendering page. When client has accept the JSON, client will rendering the value. you can using javascript template engine to doing this and one of is http://beebole.com/pure/
Clear out as much whitespace as possible, since it's generally unnecessary anyway. There may other ways to literally reduce the amount of HTML being sent.
Since AJAX calls are asynchronous, you could break the response up into chunks by doing several AJAX calls in close succession, basically allowing for multiple near-simultaneous downloads. It could likely increase the load on the server and require a little bit more intelligent JS and server programming, but if client speed is the main concern, it could be worth it.
精彩评论