MyBB Community Forums

Full Version: Browsers cache avatars, changes require a refresh
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi guys,
I noticed that after changing one's avatar requires a refresh or two in most browsers to see the changed avatar. I think it's because most browsers cache users' avatars, and Mybb uploads new avatars to the same url as old ones.

How should I fix this? I could use .htaccess to prevent caching of all images, but I don't really want to do that.
I don't see the big deal and also not sure why you posted this in the MyBB support forum. Their is no "fix" for it as their is nothing broken. Just do an F5 and you will see your new avatar.
Right, I know it works fine for me, as I know to refresh. I've got users complaining to me though about how they, "can't see their new avatars".
Tell him to clear his cache by pressing F5, I can't really see how this is a problem as it's his own choice to refresh his cache or not.
This is changed for 1.6 but most people's browsers update fine.
Ok, cool. Thanks Matt.
You could apply the .htaccess only to avatars, and don't prevent caching, just force a verification.
I think in Server Optimization settings you can send no-cache headers but I think that may just be for pages.. That's all I can think of anyway. .htaccess with be your best bet.
Ah, I suppose I could put the .htaccess file in the avatar directory...Thanks for the idea.