muni-town / weird

Weird web pages
https://weird.one
Other
51 stars 11 forks source link

Profile picture is not updating after profile edit #178

Closed harshmangalam closed 1 week ago

harshmangalam commented 2 months ago

This is reflecting in personal site https://harshmangalam.weird.one/ but not in weird profile page

zicklag commented 2 months ago

It shows correctly for me:

image

I think it might be related to browser caching, probably related to #166.

I wonder if we might be able to fix it by adding an Etag or some other cache control headers to our avatar responses. I'll leave this open so that we can research that more.

zicklag commented 2 months ago

I pushed an update that properly adds the Etag header to help inform the browser of the image's changes and improve caching, so that may have fixed this, but I'm not sure yet.

zicklag commented 4 weeks ago

I can confirm this still happens, but pressing ctrl + shift + R to force reload will snap the browser out of it, so it must be a browser caching thing.

I only notice this when first setting my avatar, so it must have something to do with switching from the randomized avatar to a custom avatar. We may just need to add some cache control headers to the generated avatars or something, or we need to actually stored the randomized avatar in our database when the user signs up. 🤔 That might be a better solution. It means we use more storage for users without avatars, but we expect all users who really want to use it to pick an avatar anyway, so that's not actually a big deal.

That would also fix https://github.com/muni-town/weird/issues/207

zicklag commented 1 week ago

Fixed in 2a3b32c32b117a205bc7a7cb260dcbb1d1b6dd7c