From 074785cea106179cb3305637055ab0a009ca74f2 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:52 -0500 Subject: initial commit --- .../vary/index.html" | 81 ++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 "files/ru/web/http/\320\267\320\260\320\263\320\276\320\273\320\276\320\262\320\272\320\270/vary/index.html" (limited to 'files/ru/web/http/заголовки/vary/index.html') diff --git "a/files/ru/web/http/\320\267\320\260\320\263\320\276\320\273\320\276\320\262\320\272\320\270/vary/index.html" "b/files/ru/web/http/\320\267\320\260\320\263\320\276\320\273\320\276\320\262\320\272\320\270/vary/index.html" new file mode 100644 index 0000000000..a9bf3238e6 --- /dev/null +++ "b/files/ru/web/http/\320\267\320\260\320\263\320\276\320\273\320\276\320\262\320\272\320\270/vary/index.html" @@ -0,0 +1,81 @@ +--- +title: Vary +slug: Web/HTTP/Заголовки/Vary +translation_of: Web/HTTP/Headers/Vary +--- +
{{HTTPSidebar}}
+ +

Заголовок ответа Vary определяет, как сопоставить будущие заголовки запроса, чтобы решить, можно ли использовать кэшированный ответ, а не запрашивать новый с исходного сервера. Он используется сервером для указания того, какие заголовки он использовал при выборе представления ресурса в алгоритме согласования контента.

+ +

Заголовок Vary должен быть установлен для ответа {{HTTPStatus("304")}} Not Modified точно так же, как он был бы установлен для эквивалентного ответа {{HTTPStatus("200")}} OK.

+ + + + + + + + + + + + +
Тип заголовка{{Glossary("Response header")}}
{{Glossary("Forbidden header name")}}no
+ +

Syntax

+ +
Vary: *
+Vary: <header-name>, <header-name>, ...
+
+ +

Directives

+ +
+
*
+
Каждый запрос должен рассматриваться как уникальный и не кэшируемый. Лучший способ указать это - использовать {{HTTPHeader ("Cache-Control")}}: no-store, который удобнее для чтения и также сигнализирует о том, что объект не должен храниться никогда.
+
<header-name>
+
Разделенный запятыми список имен заголовков, которые необходимо учитывать при принятии решения о том, можно ли использовать кэшированный ответ.
+
+ +

Examples

+ +

Dynamic serving

+ +

When using the Vary: User-Agent header, caching servers should consider the user agent when deciding whether to serve the page from cache. For example, if you are serving different content to mobile users, it can help you to avoid that a cache may mistakenly serve a desktop version of your site to your mobile users. It can help Google and other search engines to discover the mobile version of a page, and might also tell them that no Cloaking is intended.

+ +
Vary: User-Agent
+ +

Specifications

+ + + + + + + + + + + + +
SpecificationTitle
{{RFC("7231", "Vary", "7.1.4")}}Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content
+ +

Browser compatibility

+ + + +

{{Compat("http.headers.Vary")}}

+ +

Compatibility notes

+ + + +

See also

+ + -- cgit v1.2.3-54-g00ecf