# 关于“early hint header”全局设置的问题

**URL:** https://meta.discourse.org/t/question-about-early-hint-header-global-settings/302977
**Category:** Support
**Created:** [2024 年4 月 9 日 06:33 UTC](https://meta.discourse.org/t/question-about-early-hint-header-global-settings/302977 "2024-04-09T06:33:44Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### 作者： ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### 发布日期： [2024 年4 月 9 日 06:33 UTC](https://meta.discourse.org/t/question-about-early-hint-header-global-settings/302977/1 "2024-04-09T06:33:44Z")

</div>

你好 👋

当这个 [EXPERIMENTAL: preconnect and dns-prefetch resource hints for CDN doma… · discourse/discourse@36cdb14 · GitHub](https://github.com/discourse/discourse/commit/36cdb1444c8fd1fde6c1803b943a42b96cf58a14) 站点设置可用时，我在我的站点上启用了它。之后，此提交已在此处 [DEV: Consolidate experimental 'Link' header implementations (#26377) · discourse/discourse@1cc8c72 · GitHub](https://github.com/discourse/discourse/commit/1cc8c72a98fd85b7f57dbf26a81d34d1e0cff917) 更改为全局设置。

我已经启用了全局设置 `early_hint_header_mode` 的 preconnect，但我看到还有一个全局设置 `early_hint_header_mode` 的 prefetch。是否可以同时启用两者，或者是我有什么误解？🤔

谢谢 🙂

---

<div class="post-metadata">

### 作者： ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### 发布日期： [2024 年9 月 6 日 07:11 UTC](https://meta.discourse.org/t/question-about-early-hint-header-global-settings/302977/3 "2024-09-06T07:11:22Z")

</div>

tuning early\_hint\_header\_mode 的唯一方法是通过全局设置。

这通常通过为容器设置环境变量来完成：

`DISCOURSE_EARLY_HINT_MODE` 可以是 `preconnect`、`preload`、`prefetch` 或留空。

自托管用户将在其 `app.yml` 文件中进行设置。

此设置只能有一个值。自托管用户可以通过以下方式验证其值：

```plaintext
./launcher enter app
rails c

> GlobalSetting.early_hint_header_mode

```

Early hints 是一个相当复杂的设置，因为代理需要支持它们，而许多代理并不支持。

---

<div class="post-metadata">

### 作者： ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### 发布日期： [2024 年10 月 6 日 07:11 UTC](https://meta.discourse.org/t/question-about-early-hint-header-global-settings/302977/4 "2024-10-06T07:11:40Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
