我正在使用CloudFront CDN为一个移动应用程序提供图像。
我在电脑上的浏览器上测试了下载速度,图像(大约60kb)几乎立即出现。
然而,在iOS应用程序中,下载需要0.3 - 0.4秒。为了下载图片,我在后台线程上使用了dataWithContontentsOfURL方法。
NSData *imageData = [NSData dataWithContentsOfURL:categoricalSystemURL];
为什么图像在浏览器中的加载速度要快得多?有没有更快的方法在iPhone上下载图片?
发布于 2016-04-20 16:07:35
试用此解决方案dataWithContentsOfURL and imageWithData take 84% of the whole loading time
将Nsdata编码为Uiimage需要一些时间。
https://stackoverflow.com/questions/36737459
复制相似问题