Understanding Facebook Profile Photo Caching
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:
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."
Post is closed for comments.