You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Log in as a user and go to My Account -> Change avatar
Upload an avatar from computer
Verify that the avatar was uploaded in a chat room
Get URL of the avatar, which looks like this: /avatars/filename.jpg
Make cURL request to that URL: curl -vv http://pathtochat.com/avatars/filename.jpg
Make note of Last-Modified header.
Repeat steps 1-6 with a different avatar file
When uploading the avatar for the second time, Last-Modified header should be updated as well, but that doesn't seem the case. Upon further investigation it seems that the uploadDate field in avatars.files collection contains the first upload date and doesn't change when uploading another avatar. This leads to caching issues with some browsers showing old avatar instead of new one, because the browser sends If-Modified-Since header and the server then responds with 304 Not Modified.
I was digging through code and it seems to me that the issue is within the GridFS itself, which doesn't update uploadDate when it overwrites files. A possible workaround would be remove the file before re-uploading it again, but I can't seem to find where exactly storing the avatar file happens in the code.
The text was updated successfully, but these errors were encountered:
Steps to reproduce:
/avatars/filename.jpg
curl -vv http://pathtochat.com/avatars/filename.jpg
Last-Modified
header.When uploading the avatar for the second time,
Last-Modified
header should be updated as well, but that doesn't seem the case. Upon further investigation it seems that theuploadDate
field inavatars.files
collection contains the first upload date and doesn't change when uploading another avatar. This leads to caching issues with some browsers showing old avatar instead of new one, because the browser sendsIf-Modified-Since
header and the server then responds with304 Not Modified
.I was digging through code and it seems to me that the issue is within the GridFS itself, which doesn't update
uploadDate
when it overwrites files. A possible workaround would be remove the file before re-uploading it again, but I can't seem to find where exactly storing the avatar file happens in the code.The text was updated successfully, but these errors were encountered: