# 头像迁移到 S3 兼容的 R2 后加载时间过长

**URL:** <https://meta.discourse.org/t/avatars-take-a-long-time-to-load-after-moving-to-s3-compatible-r2/405827>\
**Category:** Self-hosting\
**Tags:** s3\
**Created:** [2026年六月22日 14:49 UTC](https://meta.discourse.org/t/avatars-take-a-long-time-to-load-after-moving-to-s3-compatible-r2/405827 "2026-06-22T14:49:05Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [2026年七月2日 16:42 UTC](https://meta.discourse.org/t/avatars-take-a-long-time-to-load-after-moving-to-s3-compatible-r2/405827/13 "2026-07-02T16:42:18Z")

</div>

> [@David\_Ghost](#):
>
> 是的，我两个都在用。

除了那个无法使用的那个？

> [@David\_Ghost](#):
>
> 在进行 R2 测试时，我没有使用 Discourse CDN URL。

那么，没有使用 Discourse CDN 的 R2 配置就是你遇到问题的地方？

我不假装完全理解你的问题，也不完全清楚头像图片的工作原理，但我建议在进一步测试之前先配置好 CDN。问题_可能_在于你迁移到了新的存储桶，而这些图片需要重新生成。

这里的头像加载自看起来像 Discourse CDN 的地址：[https://sea3.discourse-cdn.com/meta/user\_avatar/meta.discourse.org/lilly/48/555832\_2.png](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/48/555832_2.png)

用户个人资料在首次加载后，后续加载速度会变快吗？

> [@Lilly](#):
>
> 所以我认为这完全绕过了 CDN，这就解释了 3 秒的延迟——我怀疑服务器在每次请求时都在手动获取并加载文件 😬

同样，我不保证我完全理解，也没有查看过代码，但我猜测这些图片是由 Discourse CDN 提供的，而 Discourse 则依赖后续请求从 CDN 获取数据。我认为这解释了为什么在没有 Discourse CDN 的 R2 版本上无法正常工作（或工作缓慢）。

---

_[View the full topic](https://meta.discourse.org/t/avatars-take-a-long-time-to-load-after-moving-to-s3-compatible-r2/405827)._
