ASIHTTPRequest 与 NSURLConnection [英] ASIHTTPRequest vs NSURLConnection

查看:35
本文介绍了ASIHTTPRequest 与 NSURLConnection的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是想知道哪个在性能和可用性方面更快?或者如果那里有更好的东西?

Just wondering which is faster in terms of performance and usability? Or if there's anything better out there?

推荐答案

这里有一些与旧版本相关的性能信息:

There's some performance information relating to an old version here:

http://allseeing-i.com/ASIHTTPRequest-1.5

这相当可比.我不确定是否有更新版本的数字.

It's pretty comparable. I'm not sure if there are any figures for more recent versions.

请注意,最新的 ASIHTTPRequest 内置了对缓存的支持(NSURLConnection 没有) - 如果您启用它并且它适用于您的使用,它将为您带来重大的加速.

Note that the most recent ASIHTTPRequest has built in support for caching (which NSURLConnection doesn't) - if you enable that and it's applicable for your use it gets you a major speedup.

ASIHTTPRequest 还免费为你做很多事情;例如,如果您愿意,它可以透明地处理 HTTP 代理身份验证.

ASIHTTPRequest also does a lot of things for you for free; it can transparently handle HTTP Proxy authentication if you want it to, for example.

我一直选择 ASIHTTPRequest 而不是 NSURLConnection:对我来说,缓存是真正的主要优势,但其他一切都很好.

I pick ASIHTTPRequest over NSURLConnection all the time: for me the caching was the real major advantage, but everything else is certainly nice to have.

如果您决定使用 ASIHTTPRequest,请使用最新的 git master,而不是 v1.7 版本 - 后者有一些错误会在取消请求时导致崩溃,还有一些其他问题已在 master 中修复.

If you do decide to use ASIHTTPRequest, do use the latest git master, not the v1.7 release - the latter has some bugs that cause crashing when cancelling requests and a few other issues which are fixed in master.

这篇关于ASIHTTPRequest 与 NSURLConnection的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆