Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

用户头像无法修改 #637

Closed
songjiayang opened this issue May 11, 2016 · 4 comments
Closed

用户头像无法修改 #637

songjiayang opened this issue May 11, 2016 · 4 comments

Comments

@songjiayang
Copy link
Contributor

  1. 用户未设置头像,通过修改个人信息,上传头像,立即成功。
  2. 当已有头像,再通过个人信息修改头像,提示信息修改成功,但是头像没有变化。

查看了用户头像图片地址为 https://ruby-china-files.b0.upaiyun.com/user/big_avatar/2973.jpg

疑问:
这个头像没有加时间戳,或者digest 的数值,在又拍云和客户端本地应该都会有缓存,那么怎么让用户头像第一时间生效呢?还是因为考虑全站帖子和回帖缓存策略,保持图片地址不变,不管这个问题,让右派去处理。

@huacnlee
Copy link
Member

浏览器刷新就对了,由于 UpYun 的缓存模式,以及 Fragment Cache 的设计,我需要固定用户头像的 URL,确保用户改了头像 URL 还是一样的,这样用户头像修改缓存就不用清理。然后配合 UpYun 的缓存策略(1周 + ETag 检查)来实现头像更新。


如果这里要细致点,对用户 profile 界面修改这个问题,可以在修改完以后头像后面增加个 ?t=Timestramp,让用户在那个界面看到更改后的结果。

@songjiayang
Copy link
Contributor Author

@huacnlee 👍
这是我想要得答案.

@huobazi
Copy link
Contributor

huobazi commented May 11, 2016

这个我之前也弄过,#146

这样处理了,对于其他 View 上有 Fragment Caching 的页面,仍然会有问题

@songjiayang
Copy link
Contributor Author

@huobazi 其他页面确实有问题,但是这里需要解决的是给用户一个反馈,意味着修改成功了。

其他页面,因为缓存策略,性能优先,其实这个头像有点延迟,大家也会知道是缓存问题。

huacnlee added a commit that referenced this issue Apr 10, 2017
Fragmement Cache 带上 user_avatar 的值,便于用户头像变更的时候能更新缓存。
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants