Third party What's up with gravatar

I'm experiencing this problem too on my board (and here, for that matter). Gravatars in Xenforo haven't updated since December on my forum! Meanwhile, I log into my old bbPress forum and I can see all the current Gravatars. I have a hard time understanding how this isn't an issue with Xenforo code, since it works fine on WordPress blogs and other forums that utilize Gravatars.
 
Having poked around more sites where I use Gravatar, I do have add that the only place they are not updating now is on XF-powered forums. If I use a direct URL, I can access my current one:

03502e40a05254109202e6954e88bf33.jpg


Not only that, if I go to my user settings here or on my other XF forums, my current Gravatar displays, yet out in the forum it still shows the old one. Here at xf.com my large avatar sample is correct, whereas on another forum, it is not correct. Here are the samples. Note that my screen shots include my gravatar underneath the control panel window as it appears out in the forum. In XF.com it's my "M Go Blue" whereas in the others, it's the Charlie Brown Xmas Tree.

This is here on xf.com in this very thread, and is the most outdated of all the Gravatars (this hasn't been used in at least two months, so it's about three or four Gravatars ago):

gravatar_fail_1.webp

And this is from another forum, which has my last Gravatar from December (notice, too, the discrepancy):

gravatar_fail_2.webp

Are we sure this isn't some kind of bug in XF? It's the only package I use that doesn't have Gravatars updating...especially a Gravatar that is maybe three or four versions behind!
 
One thing I just noticed... when I had a Gravatar rated PG, it wasn't displaying in the Avatar Editor. When I switched to a rated G Gravatar, it showed up. But I can't find any setting in the Admin control panel to select between Gravatar Ratings. Or am I missing it?
 
not sure why you guys are using Gravatar at all?
I have Gravatar disabled.

From Gravatar.com: "Your Gravatar is an image that follows you from site to site appearing beside your name when you do things like comment or post on a blog. Avatars help identify your posts on blogs and web forums, so why not on any site?"

That's why we use Gravatar.
 
One thing I just noticed... when I had a Gravatar rated PG, it wasn't displaying in the Avatar Editor. When I switched to a rated G Gravatar, it showed up. But I can't find any setting in the Admin control panel to select between Gravatar Ratings. Or am I missing it?

My Gravatars are all G rated, but I have problems in numerous XF forums with improper ones showing. And only XF forums. Nowhere else.
 
I think I may have found the problem. This could be completely wrong, but I've found that my gravatar doesn't update when I change the file type. The usual perma-link you get for your gravatar gets changed to the new file extension, thus, changing the url. Say you had...

gravatar.com/avatar/id.jpg

Then you changed it to

gravatar.com/avatar/id.png

I've found it won't update :/
 
I think I may have found the problem. This could be completely wrong, but I've found that my gravatar doesn't update when I change the file type. The usual perma-link you get for your gravatar gets changed to the new file extension, thus, changing the url. Say you had...

gravatar.com/avatar/id.jpg

Then you changed it to

gravatar.com/avatar/id.png

I've found it won't update :/

That's never been a problem for me on other Gravatar-supported sites. What happens when you switch back to jpg?
 
I've done some testing, I believe it's a Google Chrome issue.

Test 1 - Chrome
  • Changed Gravatar
  • Cleared all browsing data
  • Restarted browser
  • Still see old gravatar

Test 2 - Firefox
  • Changed Gravatar
  • Waited a few minutes
  • Could see new Gravatar
 
Chrome aggressively caches images.

Clearing the cache is sometimes the only way of getting updated images to show.
 
As soon as you send parameters to Gravatar (as documented in their API), that is what triggers the over the top caching. Parameters are always needed by XenForo for the size parameters (vs the 80px which is the default).

I reiterate that there is basically nothing we can do about this. I have contacted them but have had no response. (I have disabled Gravatar by default because of this.)
 
Chrome aggressively caches images.

Even more curiously, the Gravvie is now showing up here correctly today, after two months of showing the incorrect one. (Which of course, means that I'll probably get tired of it and change it again soon. :D ) No change on any of my other XF forums, or those I visit...still stuck on the old ones.

I'm going to be looking into Gravatar myself for another ongoing project. It will be interesting to see what happens.

 
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!
 
I changed my Gravatar right after making my last post here.

I was experimenting with the URL again. Before I changed my Gravatar, I tried the timestamp trick on another problematic URL, and it worked. But that wasn't good enough for me. I had to test it right in XenForo.

Taking it a step further, I found that the function _getGravatarUrl() is where the URL is generated. I notice the function appears both in /library/XenForo/Template/Helper/Core.php and /library/XenForo/Model/Avatar.php, and have edited both with the following code within the _getGravatarUrl() function (adding the $xftime = line right before the return line):

PHP:
        $xftime = '&xftime=' . time();
 
        return (XenForo_Application::$secure ? 'https://secure' : 'http://www')
            . ".gravatar.com/avatar/{$md5}.jpg?s={$size}{$xftime}{$default}";
Result? I have changed my Gravatar six times in the past five minutes, and by simply refreshing the page, the correct Gravatar loads instantly...as it should. Going back to another unaltered forum, I cannot get the Gravatar to change no matter how many times I refresh or deal with the cache.
I don't know if this is sloppy or a hack or whatever, and I can't explain it completely, but...it works!
 
Back
Top Bottom