Cache gravatar images locally

Dave Reid - November 15, 2008 - 03:13
Project:Gravatar integration
Version:6.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:Dave Reid
Status:postponed
Description

Eventually I'm going to work on a way to cache the Gravatar images locally. If the user has a Gravatar image, the module will grab it and save it in the files/picture directory. This will be an interesting feature to code, but I wanted to put it out there to see if there is any interest in this.

#1

Narno - November 16, 2008 - 16:32

Hmm, I'm not sure this is a real interest because our browsers already manages the cache images, especially the image is accessible by a unique URL, thus easily cached by the browser. No?

#2

Dave Reid - November 16, 2008 - 18:54

Yes the Gravatars could be cached by the browser, but what I'm envisioning is having the module actually 'grab' the image file and store it so the image file will be served from the same domain as the website, instead of Gravatar.com. If a site has a lot of comments and a lot of Gravatars being displayed, this causes a lot of 'external' requests and could possibly slow down the page being displayed. Either way this would be an advanced option for people concerned with site performance.

#3

Narno - January 11, 2009 - 17:49

For example Yahoo! intends to call its Javascript libraries (YUI) on a centralized server rather than to download these libraries locally, for the sake of performance for websites. This is exactly what Gravatar do.

It will be interesting to make a benchmark between the 2 solutions : externals requests on gravatar.com and internals pictures loading.

#4

turadg - October 27, 2009 - 01:09

Other modules that expect the avatar in the DB would benefit from caching them. E.g. #615458: Doesn't work with site_user_list module

#5

jumpfightgo - November 17, 2009 - 00:06

I think this is a great idea. Web services that on occasion are slow or unreachable (twitter especially!) can dramatically slow down the load time for a site.

 
 

Drupal is a registered trademark of Dries Buytaert.