Third party What's up with gravatar

Yes that will work, but it will also load a new image on every. single. page. view. So it will slow things down and waste bandwidth. I don't think that's an acceptable tradeoff.

You have effectively just (re-)confirmed that it's a Gravatar issue.
 
Mike,

You're right (and I didn't point it out after my "experiments"): I can paste in a URL, bypassing XF entirely and still retrieve a stale Gravatar.

You have effectively just (re-)confirmed that it's a Gravatar issue.

What puzzles me the most is where the image is being cached. Why can I always pull up a fresh Gravatar if I use the simple URL to the JPG file, yet get a stale Gravatar if I use that URL with the extra options added to it? Or to put it another way, what is it about the longer URL that Gravatar does not like that is making it fetch stale Gravatars?

If you think about the nature of Gravatars, and how they could change on moment's notice, it almost makes sense for them not to cache the Gravatars, or at least have a shorter timeout of 12 or 24 hours so they update in a timely fashion. But, whatever is "stuck" in their system made it serve up Gravatars that are almost two months old.

One solution that may work and save bandwidth: use a timestamped URL in the avatar editor only. I noticed that once I "woke up" their system by manually inserting a timestamp in the Gravatar's image URL in the browser's address bar (copied and pasted from the "developer" window in Chrome), the Gravatar then started working normally throughout the forum using the standard XF-generated URL.

The forums I have don't generate enough traffic that I'm worried about bandwidth, but I would not try it on a busy "big board" like the one I'm considering switching over to XF. In that case, I would simply disable it...or would enable it with the warning that it may not update Gravatars in a timely manner.
 
Thanks to a dialog I opened with the folks at Gravatar, I may have found a solution to this.

XenForo sends Gravatar image URLs with a .jpg extension; however, that is not required by the API. Instead, send the URL without the .jpg extension, and I am finding that the Gravatar feature works more reliably.

I have two XenForo installations, so I am able to edit files in one instance and not the other. On the unedited instance, I am still loading a stale Gravatar that has been changed four times since. On the edited instance, while the change does not take place right away in all avatar sizes, it does kick in on all of them usually well within the hour. I've tried it on a few separate days, and so far it is working far better.

For their part, a "Happiness Manager" has also sent my request along to investigate why Gravatars load stale with a JPG extension, and occasionally are not as fast without the extension. But there is no requirement to use the extension, and as I am finding, Gravatars are more reliable now and I have no qualms about enabling the feature once I've modified the two files needed to change the URL that XenForo generates.

If you decide to perform the edits, you do so at your own risk; always make a backup of your original files! In both cases, you are looking at the "{$md5}" in the code to delete the ".jpg" immediately after.

...../library/XenForo/Template/Helper/Core.php
Around line 1753, find this:

PHP:
        return (XenForo_Application::$secure ? 'https://secure' : 'http://www')
            . ".gravatar.com/avatar/{$md5}.jpg?s={$size}{$default}";

Replace with:

PHP:
        return (XenForo_Application::$secure ? 'https://secure' : 'http://www')
            . ".gravatar.com/avatar/{$md5}?s={$size}{$default}";


...../library/XenForo/Model/Avatar.php
Around line 496, find this:

PHP:
        return (XenForo_Application::$secure ? 'https://secure' : 'http://www')
            . ".gravatar.com/avatar/{$md5}.jpg?s={$size}{$default}";

replace with:

PHP:
        return (XenForo_Application::$secure ? 'https://secure' : 'http://www')
            . ".gravatar.com/avatar/{$md5}?s={$size}{$default}";
Quite simple. I'm still monitoring results and trying to change my Gravatar daily (with both existing and new Gravatars), but I am finding Gravatar works better.
 
It originated from a post on the Gravatar blog...I complained a bit, someone got me a link to contact them, and that started the whole dialog. Had I known it was that easy, I'd have done it sooner. :D

For their part, my contact at Gravatar mentioned that they would be checking to see why images aren't loading properly when the .jpg extension is used. Either should work, but both do not work equally, it seems.

I'm still not fixing my other forum--I want to make certain it is a valid fix to the problem. So far it seems to be, as I no longer have a stale Gravatar for days or months after the fact. My Gravar here, in fact, is at least a few months old and I've changed it over a dozen times since!
 
Here is an interesting twist.

This morning, I popped into a couple of XF forums (including this one) that don't have the fix applied, and my current Gravatar loaded up in both, first thing this morning. Prior to this morning, my Gravatar here was months out of date, as I'd changed it at least a dozen times since. On the forum I hadn't modified, the Gravatar was about four or five versions behind; that one popped in this morning also.

Makes me wonder if Gravatar is fixing their implementation, or if I just hit a fluke. Anyone else see a change?
 
Here is an interesting twist.

This morning, I popped into a couple of XF forums (including this one) that don't have the fix applied, and my current Gravatar loaded up in both, first thing this morning. Prior to this morning, my Gravatar here was months out of date, as I'd changed it at least a dozen times since. On the forum I hadn't modified, the Gravatar was about four or five versions behind; that one popped in this morning also.

Makes me wonder if Gravatar is fixing their implementation, or if I just hit a fluke. Anyone else see a change?
Lol aye looks like its finaly fixed, Ive just changed it on Gravatar and it's working right on here and other xenforo sites :)

Maybe you chat did indeed HELP! :D:D:D
 
I'm going to test it more later on this evening. I don't mind if the change takes an hour or two (I fully understand caching, and that it takes time to flush them), but when there were stale Gravatars dating back several months, it got to be ridiculous. :D I hope it IS fixed! Yet if it's not, we still have the above modification that seems to work.
 
You bet! Try it again and see if it works any better for you. The more that can confirm it works, the better.
Well, I just enabled it, though i can't really remember what avatar I had enabled prior to this. So I changed it, but it did not update immediately, so I will give it some time to see what happens..
 
Disabled it again, still not fixed. I uploaded a new avatar, changed it, no go. Changed the URL to the avatar a little bit, it was updated, then changed it again and several force refreshes and nothing. Guessing they flushed the cache and some avatars got updated, but the root issue is still at hand.
 
I've noticed that even after my "fix" it can take an hour or so before the Gravatar settles in everywhere.

Would you be willing to try the fix and see if it helps you at all? I edited another forum and it appears they are updating there now as well. The more who can confirm the "without .jpg" fix works, the better. At least I can prove to myself that I'm hopefully not seeing a fluke on the two forums I fixed. ;)
 
Aye its still not "quite" right look at my avatar, now click on it and it will show "edi" from mass effect and not saya which it is now. still tho at least it updates on the forum pages quicker. :D
 
I don't know if the fix did the trick, but on four XF forums now where I have applied the fix, my Gravatar is changing almost instantly, and in all places.

But then I came here, and it has also changed.

I wonder if my prodding into the matter with Gravatar/Automattic finally got it fixed. (Or did XF apply the fix here also?)

What's my current Gravatar? Game 2, ALCS...Tigers vs. Yankees. :D
 
Here's a recent Gravatar change:

http://blog.gravatar.com/2012/10/09/default-image-changes/

Short excerpt:


Default images must be publicly accessible via a simple HTTP or HTTPS request on the standard ports of 80 and 443, respectively. They must have a valid image file extension of jpg, jpeg, png, or gif.

If your default image is not publicly accessible, doesn’t have a file extension, is not actually an image, requires HTTP Authentication, or is otherwise unavailable to a normal web request, it cannot be used as the fallback/default image for a Gravatar.

As for my other Gravatar issues, there seem to be none--Gravatars are now changing instantly, even here.
 
Top Bottom