PDA

View Full Version : Suggestion: add randon number to avatar image


bira
Thu 22nd Feb '01, 12:35pm
Hi,

Because the avatar image "name" is always avatar.php?s=&userid=$userid several users pointed out that they try to replace the avatar and it doesn't work. In effect, it DID work, they just didn't see the change because the older avatar was cached and since the name of the image did not change, the browser 'thought' that it already exists (this is particularly true for Netscape users).

I won't lose sleep over this, but I thought of suggesting a simple fix:

add at the end of the avatar.php?s=&userid=$userid another variable, which actually means nothing - it's just unixtime and therefore the image "name" will never be the same. So it would like like:

$rand = time();
avatar.php?s=&userid=$userid&rand=$rand&

Hope that makes sense.

Cheers,

Bira

AaronB
Thu 22nd Feb '01, 1:47pm
It makes sense but will also increase your bandwidth greatly.

In the current state... the image is downloaded once per page because they all have the same name. With the name constantly changing, it will require the same image to be downloaded over and over again.

Especially when going page to page when the number will be changing every time, every avatar will have to be downloaded over and over again instead of once.

I see your point, but I would rather have them restart their browser if they HAVE to see the change right then... then have to pay for the extra bandwidth that would accumulate over the month.

bira
Thu 22nd Feb '01, 2:03pm
OK, I see your point.

Then how about incrementing a number every time they replace the avatar?

eg they start with avatar.php?s=&userid=$userid&no=1

Next they replace the image, so it becomes avatar.php?s=&userid=$userid&no=2

etc...

Anyways, like I said, it's no big deal, it's just a thought of just slightly bettering it.

Freddie Bingham
Thu 22nd Feb '01, 2:34pm
Put a note in your avatar template telling the users that they may need to refresh their browser or even restart it if they still use Netscape.

bira
Thu 22nd Feb '01, 3:45pm
alright I guess :)