Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[zh-TW]: update HTTP Header "Accept-CH" #25363

Merged
merged 2 commits into from
Jan 21, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions files/zh-tw/web/http/headers/accept-ch/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
title: Accept-CH
slug: Web/HTTP/Headers/Accept-CH
l10n:
sourceCommit: 3350169912a6150f2af78d6ecf5e22fd7cfc4335
sourceCommit: 92b03e46cef6be37de60799363e3e33e3415b491
---

{{HTTPSidebar}}{{securecontext_header}}

**`Accept-CH`** 標頭可以由伺服器設置,以指定用戶端應該在後續請求中包含哪些[用戶端提示](/zh-TW/docs/Web/HTTP/Client_hints)標頭。
HTTP **`Accept-CH`** {{Glossary("response header")}} 可以由伺服器設定,以指定用戶在後續請求中應包含哪些[用戶提示](/zh-TW/docs/Web/HTTP/Client_hints)標頭。為了確保用戶提示能夠可靠地傳送, `Accept-CH` 標頭應該為所有安全請求保持持久
Dr-XYZ marked this conversation as resolved.
Show resolved Hide resolved

<table class="properties">
<tbody>
Expand All @@ -28,25 +28,26 @@ l10n:
</tbody>
</table>

> [!NOTE]
> 用戶端提示僅在安全來源(通過 TLS)上可訪問。應該對所有安全請求持久化 `Accept-CH` 標頭,以確保可靠地發送用戶端提示。

## 語法

```http
Accept-CH: <comma separated list of client hint headers>
Accept-CH: <client-hints-headers>

// 用戶提示標頭,以逗號分隔的列表
Dr-XYZ marked this conversation as resolved.
Show resolved Hide resolved
Accept-CH: <ch-header-one>, <ch-header-two>
```

## 範例

### 用戶提示回應標頭
Dr-XYZ marked this conversation as resolved.
Show resolved Hide resolved

以下回應標頭表示伺服器在後續請求中接受 `Viewport-Width` 和 `Width` [裝置用戶提示](/zh-TW/docs/Web/HTTP/Client_hints#裝置用戶提示)。{{HTTPHeader("Vary")}} 標頭表示根據接受的用戶提示來[變更回應](/zh-TW/docs/Web/HTTP/Client_hints#快取與用戶提示)的值。
Dr-XYZ marked this conversation as resolved.
Show resolved Hide resolved

```http
Accept-CH: Viewport-Width, Width
Vary: Viewport-Width, Width
```

> [!NOTE]
> 請根據接受的用戶端提示來[改變回應](/zh-TW/docs/Web/HTTP/Client_hints#快取和用戶端提示)。

## 規範

{{Specifications}}
Expand Down
Loading