Replies: 1 comment
-
Thanks for this. I guess this is useful! The implementation is done in #2048 Hopefully, I can find a chance to check it in detail and merge/release it later. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
通常情况下,列表里UIImageView会拉取url用以显示图片、视频的首帧图(通过kingfisher下载图片失败时,则断定url为视频,此时通过另外的方法获取视频首帧图,并将图片和url保存至ImageCache,以后使用此url即拉得到本地缓存首帧图)。
但使用过程中,发现只要url正确,建立了URLSessionDataTask之后,会完全下载内容,如果url为视频等其他文件,也会完全下载导致加载时间过长且流量消耗过大。
如果能校验一下url对应文件的Content-Type为图片时,再去下载的话,可以节省很多网络开销。
附上代码:
Beta Was this translation helpful? Give feedback.
All reactions