Closed (fixed)
Project:
Avatar gallery
Version:
5.x-1.x-dev
Component:
Miscellaneous
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Nov 2007 at 18:55 UTC
Updated:
25 May 2008 at 02:12 UTC
There may be a simple solution for this, but does anyone have any idea how to force the user's browser to retrieve the avatar gallery image every time the page is fetched, as opposed to retrieving it from the local cache? What I'm finding is it's all working dandy except that on the user's local machine, i have to force a refresh from the server on the page where I have the gallery (which is the home page) in order for the new image to show up with new avatars. Does anyone know how to have this done 'automagically', as opposed to me having to force it as a user (with the old shift-key-refresh method)?
Comments
Comment #1
ekrispin commentedHaving the same problem.
Moreover, you can notice that when new users are registering, the links in the avatar gallery block turn to be mismatching (avatar pics pointing not to the profile of the corresponding users).
Comment #2
ekrispin commentedOK, the analysis of the problem is as follows: Avatar Gallery uses a jpeg of the avatars and on top of that coordinates to have the thumbnail pics as links.
While the coordinates layer refreshes when a new user registers, the jpeg, though updated on the server, does not refresh of course unless you hit the refresh button of your browser (as the case with any other image).
To overcome this problem, Avatar Gallery must generate a new different file name for the jpeg each time the avatar gallery changes and thus force the browser to retrieve it from the server. The way to do it is to add some random suffix to the filename and save this current random filename in some variable to be retrieved by the other function that displays the avatar gallery.
Comment #3
ekrispin commentedAnybody maintaining this module?
Comment #4
ekrispin commentedI doubt anybody is maintaining this module at all - this, indeed critical, issue is open now for more than 5 months with not even one single tiny response.
With this bug the avatar gallery is pretty much useless in case of busy websites with constant flow of new users. This is sad since the module's functionality is fantastic and is so needed in case of a community website.
Before giving up, I will appreciate if someone deeply familiar with the code of this module will be able, after reading my analysis above, to just enlighten us with general guidelines on where exactly to plant the generation of the random name and where to keep this name (variables?) and retrieve it - and I will write the fix.
Thanks in advance!
Comment #5
omar commentedNot that this will be satisfying as it does not respond directly to your query but I thought I'd mention that after years of just leaving this module sitting on the shelf and not-providing any support, we have recently decided to re-dedicate ourselves to maintaining this and other modules that we have contributed to the community. In other words, hopefully, we'll be able to get around to answering this question, and others, soon.
Meanwhile, thanks for posting the issue and all of the follow-ups.
Omar
Comment #6
ekrispin commentedOK, to fix this bug do the following:
Change line 286 from:
To:
And change line 446 from:
To:
Now, every time the avatar_gallery image is regenerated, the name of the jpeg will change to a new random name and thus the image will be reloaded from the server.
Comment #7
ekrispin commentedOoops, forgot to delete the current image file before switching to a new name...
Add before the
$avatar_gallery_filename = 'avatar_gallery_ek'. rand(). '.jpg';the following:In other words, the replacement of line 446 should be:
Comment #8
sdsheridani've implemented these patches and am testing now. so far so good :-)
Comment #9
pfournier commentedLatest version of AG (May 10 2008) fixes the need to refresh the browser cache: each newly generated AG has a unique name. Thanks for the patch idea.
Comment #10
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.