简体   繁体   中英

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.

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? 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.

The general recommendation is to use the profile picture URLs the networks provide. Those usually redirect to a 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.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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