Cloudreve icon indicating copy to clipboard operation
Cloudreve copied to clipboard

浏览器缓存导致修改 Gravatar 之后加载头像 404

Open reekystive opened this issue 1 year ago • 2 comments

描述 Bug

Gmail 用户选择使用 Gravatar 作为头像后,由于浏览器缓存,无法加载设置的头像,而是从 disk cache 中返回了 404。

复现步骤

  1. 使用 Gmail 注册一个新 Cloudreve 账号
  2. 登录,设置头像,选择 Gravatar
  3. 刷新页面,无法显示头像,浏览器开发者工具的 Network 中显示 GET .../api/v3/user/avatar/.../s 404

第一个 404 请求的 Request Header 中有

Cache-Control: no-cache

这个请求的 Response Header 中有

Cache-Control: public, max-age=86400

导致了接下来 24h 内都无法加载设置的头像。接下来对于这个 API 的请求全部返回了

404 Not Found (from disk cache)

清除浏览器缓存,或按 Ctrl (或 Command) + Shift + R 刷新页面之后可以正常加载头像。

预期行为

修改头像后可以马上显示。

截图

第一次请求(由服务器返回,此时未修改头像,用户未设置头像)

Screenshot 2023-05-29 at 21 25 28

刷新页面后(从缓存读取,此时已修改头像为 Gravatar)

Screenshot 2023-05-29 at 21 27 43

设备信息

  • macOS Ventura 13.3.1
  • Google Chrome 113.0.5672.126
  • Cloudreve 3.8.0-beta1

reekystive avatar May 29 '23 13:05 reekystive