Interesting little experiment I just tried. To get to this point, I had to go into Chrome, right-click an incorrect Gravatar, and choose Inspect Element. This got me to the full URL being passed to Gravatar to retrieve the image.
When I use the URL for only the Gravatar image, I get the correct Gravatar every time. Such as this:
Code:
http://www.gravatar.com/avatar/03502e40a05254109202e6954e88bf33.jpg
However, if I use the full URL with parameters, such as:
Code:
http://www.gravatar.com/avatar/03502e40a05254109202e6954e88bf33.jpg?s=96&d=http%3A%2F%2Fwww.mysiteurl.com%2Fforum%2Fstyles%2Fdefault%2Fxenforo%2Favatars%2Favatar_male_m.png
...this gives me the old, incorrect Gravatar.
Yet the only difference is the addition of two URL parameters: s=96 is the size of the Gravatar (96x96 pixels); d= points to the name of the default avatar that will display if a Gravatar is not available. (In XF, this is the male or female gender "no avatar" images.)
How about this? What if you were to add a random "nonsense" string of some sort into the Gravatar image URL string? Such as a Unix timestamp. That would make it unique and should skirt by any caching. As a test, I did the following (note where I snuck in the new parameter):
Code:
http://www.gravatar.com/avatar/03502e40a05254109202e6954e88bf33.jpg?s=96&xftimestamp=1329640270&d=http%3A%2F%2Fwww.mysiteurl.com%2Fforum%2Fstyles%2Fdefault%2Fxenforo%2Favatars%2Favatar_male_m.png
The thought is this: the timestamp makes the URL request unique each time it is accessed. "xftimestamp=" is not a valid Gravatar option, so Gravatar should ignore it. Browsers, servers, etc. should see it as unique since it changes all the time.
Did it work? Perfectly! It immediately pulled in my correct Gravatar.
If there is some way a timestamp or other unique option string could be injected into a Gravatar image request, that may just be enough to relieve the...ummm...constipation of old Gravatars, no matter where the caching or "stickiness" is happening. The only issue is that it may not be easy to inject this into the URL during page generation (as I'm unfamiliar with XF's coding).
Just a thought!