[Plugin: W3 Total Cache] Cache Gravatars?
-
Would it be possible to cache gravatars?
Passing a default image to gravatar results in a lot of different URLs all pointing to the same image (either the default on Gravatar or your own default). It would be really nice if W3 could detect undefined gravatars and replace them with a direct link to a user defined value (on the CDN for example).
Example, these two URLs point to the same “Mystery Man” image:
https://www.gravatar.com/avatar/5d637371923992c2b906e862665bfa78?s=80&d=http%3A%2F%2Fwww.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D80&r=G
https://www.gravatar.com/avatar/14b42fddd993e49049a3cdcff76206c5?s=80&d=http%3A%2F%2Fwww.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D80&r=GIf you change the first URL to thie following, it returns a 404 meaning the user has no gravatar:
https://www.gravatar.com/avatar/5d637371923992c2b906e862665bfa78?d=404This could then be replaced by something like:
https://my_cdn.tld/default_gravatar.pngFor users who have a gravatar, re-writing (minify) the URLs to remove all of the extra info (specifically the “d” value) could save hundreds or thousands of bytes on chatty pages.
I would assume this gravatar checking would have to be done in the background. If a user changes their gravatar, obviously it wouldn’t update until the cache expired. Not a big deal. ??
Thanks for a great plugin!
- The topic ‘[Plugin: W3 Total Cache] Cache Gravatars?’ is closed to new replies.