Force refresh - make user-pix a special case?

Force refresh - make user-pix a special case?

by Dan Stowell -
Number of replies: 1
I've noticed on moodle.org that the site is set to force the browser to refresh the page quite often, and I've also noticed that this applies to user's personal photos ("avatars"/"pix") too.

Since the change of an avatar is not a particularly time-critical event, and since lots and lots of avatars are splashed all over the forum pages as well as others, can I suggest that you should make a special case for user pix?

I don't know exactly what this would involve as I haven't looked at the code behind it - but perhaps user/pix.php could write out its own HTTP REFRESH headers and the like, to tell browsers that user images don't expire for at least (say) 24 hours.

This would speed up page-loading for users, and would also reduce unneccessary server load. Considering the heavy use of user pix in Moodle, I can imagine it could potentially cause a very heavy unneccesary burden....
Average of ratings: -
In reply to Dan Stowell

Re: Force refresh - make user-pix a special case?

by Dan Stowell -
Having looked at the code now (!), it looks like user/pix.php is designed to do exactly that.

My Opera browser is definitely refreshing the avatars on every single visit, though, so I'd like to trace the reason.

May I ask why the line

header("Pragma: ");

doesn't have anything after the colon? I've not seen Pragma used like that before and I wonder if Opera is interpreting it as a no-cache directive. All the other headers are perfectly normal and tell the browser to do what I'd expect....

Thanks
Dan