问题
So, I'm using the Google API to fetch people's profile picture using their user_id. The Google API returns a JSON like following:
{
image: {
url: "https://lh5.googleusercontent.com/OGjgCn9fCPk/AAAAAAAAAAI/AAAAAAAAASU/AitRTc5cUyg/photo.jpg?sz=50",
isDefault: false
}
}
My question is, does this URL change? I mean will it change if the user changes their profile picture or if some CDN restructuring occurs.
Do I need to fetch it every time? Or can I just save and use it forever?
If not is their some time period for which I can save, use it directly and refresh after that time elapses?
UPDATE:
So, if we change the profile picture, the URL does change. And both the old URL and the new URL point to the same new profile picture for now.
Is there any timeout or anything after which Google will invalidate the old URL? Or will both of them continue pointing to the changed picture (and any future changes) indefinitely?
来源:https://stackoverflow.com/questions/42241699/do-the-google-profile-picture-urls-returned-by-the-google-api-change