简体   繁体   English

保存或链接到社交媒体资料图像

[英]Save or Link to Social Media Profile Image

In my app, I let users register/login with their social media accounts ie LinkedIn, Google and Facebook. 在我的应用程序中,我允许用户使用其社交媒体帐户(如LinkedIn,Google和Facebook)进行注册/登录。

My question is once I get the profile picture URL for the user, should I save the image in my system OR am I allowed to simply save the URL and let the image be served from the user's social media account? 我的问题是,一旦获得了用户的个人资料图片URL,我应该将图像保存在系统中还是允许我仅保存URL并允许从用户的社交媒体帐户投放图像? I'm not even sure if I'd be allowed to save the image as technically it could be the property of LinkedIn, Google or Facebook. 我什至不知道是否允许保存图像,因为从技术上讲,它可能是LinkedIn,Google或Facebook的财产。

The general recommendation is to use the profile picture URLs the networks provide. 一般建议是使用网络提供的个人资料图片URL。 Those usually redirect to a CDN URL. 那些通常重定向到CDN URL。 It has the advantage that changes to profile pictures are “live” immediately, and you don't have to worry about re-checking periodically. 它的优势在于,可以立即“实时”更改个人资料图片,而您不必担心会定期重新检查。

Only if you are in a situation where you have to show a massive amount of profile pics at once and the redirects are slowing stuff down, storing them on your system is an option to think about. 仅当您必须一次显示大量个人资料图片并且重定向使资料变慢时,才可以考虑将其存储在系统中。 But without any actual need, I would not go that route. 但是没有任何实际需要,我不会走那条路。

(And don't store the actual CDN URLs; at least for Facebook, because they explicitly say those are to be considered “transient”, and will change over time.) (并且不要存储实际的CDN URL;至少对于Facebook而言,因为它们明确指出这些URL被认为是“瞬态的”,并且会随着时间的变化而变化。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM