From a9deb1139268d3fb7ec73cb62c0663517989f719 Mon Sep 17 00:00:00 2001 From: Chris Mills Date: Thu, 10 Aug 2023 03:37:45 +0100 Subject: [PATCH] Add Clear-Site-Data clientHints documentation (#28476) --- files/en-us/web/http/client_hints/index.md | 2 ++ files/en-us/web/http/headers/clear-site-data/index.md | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/files/en-us/web/http/client_hints/index.md b/files/en-us/web/http/client_hints/index.md index 6b80a404b63dadf..1cdff4d905ec8d2 100644 --- a/files/en-us/web/http/client_hints/index.md +++ b/files/en-us/web/http/client_hints/index.md @@ -56,6 +56,8 @@ In other words, the request for a specific set of hints does not expire until th A server can replace the set of client hints it is interested in receiving by resending the `Accept-CH` response header with a new list. For example, to stop requesting any hints it would send `Accept-CH` with an empty list. +> **Note:** The client hints set for a particular origin can also be cleared by sending a {{httpheader("Clear-Site-Data", "Clear-Site-Data: \"clientHints\"")}} response header for a URL inside that origin. + ## Low entropy hints Client hints are broadly divided into high and low entropy hints. diff --git a/files/en-us/web/http/headers/clear-site-data/index.md b/files/en-us/web/http/headers/clear-site-data/index.md index 6245fa4cf2ae0c2..59810feb9e34908 100644 --- a/files/en-us/web/http/headers/clear-site-data/index.md +++ b/files/en-us/web/http/headers/clear-site-data/index.md @@ -42,7 +42,15 @@ Clear-Site-Data: "*" > **Note:** All directives must comply with the [quoted-string grammar](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.6). A directive that does not include the double quotes is invalid. - `"cache"` {{Experimental_Inline}} + - : Indicates that the server wishes to remove locally cached data (the browser cache, see [HTTP caching](/en-US/docs/Web/HTTP/Caching)) for the origin of the response URL. Depending on the browser, this might also clear out things like pre-rendered pages, script caches, WebGL shader caches, or address bar suggestions. + +- `"clientHints"` {{Experimental_Inline}} + + - : Indicates that the server wishes to remove all [client hints](/en-US/docs/Web/HTTP/Client_hints) (requested via {{httpheader("Accept-CH")}}) stored for the origin of the response URL. + + > **Note:** In browsers that support the `"clientHints"` data type, client hints are also cleared when the `"cache"`, `"cookies"`, or `"*"` types are specified. `"clientHints"` is therefore only needed when none of those other types are specified. + - `"cookies"` - : Indicates that the server wishes to remove all cookies for the origin of the response URL. HTTP authentication credentials are also cleared out. This affects the entire registered domain, including subdomains. So `https://example.com` as well as `https://stage.example.com`, will have cookies cleared. - `"storage"`