Get / Post 请求跨域
Post发送数据分2次,一次header,一次body,因此post会快一些缓存
XMLHttpRequest.getAllResponseHeaders()ide
XMLHttpRequest.responseTextpost
XMLHttpRequest.setRequestHeader性能
XMLHttpRequest.open()this
XMLHttpRequest.sendurl
跨域请求: 动态脚步插入orm
Multipart XHR: 切分处理ip
http://techfoolery.com/mxhr/get
imageString.split('\u0001'),
if(req.readyState===3){
window.setInterval(fn, 15)
// req.responseText.substring(lastlength, length)
}
最轻量级请求“信号灯”
var params=["step=2", 'page=3']
new Image().src=url+'?'+params.join('&')
image.onload=function(){
if(this.width==1){success}
if(this.width==2){failure, try again}
}
数据格式: 性能比较、优缺点
Verbose XML, Verbose JSON, Simple JSON, Array JSON, Custom Format(Script Insertion)
Simple XML, Verbose JSON-P, Simple JSON-P, Array JSON-P, Custom Format(XHR)
数据缓存: Cookie, Last Modified Date, Expire, Request Header, Server side configuration
Long Poll:
iframe, comet,