Understanding Facebook Profile Photo Caching
http://cloudinary.com/documentation/facebook_profile_pictures
Per the article above, Facebook photos are cached for 7 days. Thus, if a user changes their profile photo, it may take as long as 7 days for the change to be reflected via the Cloudinary API.
I have seen this article, describing the process to invalidate the cache:
http://cloudinary.com/documentation/facebook_profile_pictures
It states that the version returned by the "refresh" API call should be included in the Facebook photo API URL, so that the latest version is retrieved.
Thus, broadly speaking, in terms of implementation: if I want to ensure users are seeing their latest facebook photo, then:
1. I will need to call the "refresh" API with some frequency, perhaps when the user logs on, and save the new resulting version.
2. I will need to store this version locally, and _always_ use this version when crafting the Cloudinary URL to ensure I'm getting the latest.
3. I must presume that, when the "smart cache" does refresh its cache, the version will *not* change, as suddenly I would potentially be getting an outdated photo. Is this a correct presumption?
Alternatively, if I call the "refresh" API and do not use the resulting version, are we basically looking at a hour or so for the "default" image (e.g. the one retrieved without a version) to become updated?
"Note that it might take up to an hour for the invalidation to fully propagate through the CDN, while the version
component affects immediately."
Source: https://support.cloudinary.com/hc/en-us/articles/202521162-How-can-I-force-refresh-a-profile-picture-from-social-media-sites-
-
Hi,
Thanks for reaching out.
Your flow looks correct. Calling the Explicit API to refresh the image and checking for newer versions (the version is returned in Explicit's response) will make sure you always serve the latest profile pic. Also, add the `invalidate` parameter to purge the old image from the CDN.
Without a version component, it can take up to an hour for the purge to fully propagate through the network.
Hope it helps, let me know if you have any further questions.
Best,
0
Post is closed for comments.
Comments
1 comment