Mercurial > hg > nginx-site
changeset 1910:41cf2c2d8c5c
Cache: support for stale-while-revalidate and stale-if-error.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Wed, 15 Feb 2017 23:17:00 +0300 |
parents | 399d0e188195 |
children | f024ac0ec5c7 |
files | xml/en/docs/http/ngx_http_fastcgi_module.xml xml/en/docs/http/ngx_http_proxy_module.xml xml/en/docs/http/ngx_http_scgi_module.xml xml/en/docs/http/ngx_http_uwsgi_module.xml xml/ru/docs/http/ngx_http_fastcgi_module.xml xml/ru/docs/http/ngx_http_proxy_module.xml xml/ru/docs/http/ngx_http_scgi_module.xml xml/ru/docs/http/ngx_http_uwsgi_module.xml |
diffstat | 8 files changed, 93 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/xml/en/docs/http/ngx_http_fastcgi_module.xml +++ b/xml/en/docs/http/ngx_http_fastcgi_module.xml @@ -10,7 +10,7 @@ <module name="Module ngx_http_fastcgi_module" link="/en/docs/http/ngx_http_fastcgi_module.html" lang="en" - rev="41"> + rev="42"> <section id="summary"> @@ -631,6 +631,11 @@ The directive’s parameters match the parameters of the The <literal>error</literal> parameter also permits using a stale cached response if a FastCGI server to process a request cannot be selected. +The same behavior can be enabled with the +“<link url="https://tools.ietf.org/html/rfc5861#section-4">stale-if-error</link>” +extension of the <header>Cache-Control</header> response header field (1.11.10) +for a specified number of seconds after the response became stale, +however, this has lower priority than using the directive parameter. </para> <para id="fastcgi_cache_use_stale_updating"> @@ -638,6 +643,11 @@ Additionally, the <literal>updating</lit using a stale cached response if it is currently being updated. This allows minimizing the number of accesses to FastCGI servers when updating cached data. +The same behavior can be enabled with the +“<link url="https://tools.ietf.org/html/rfc5861#section-3">stale-while-revalidate</link>” +extension of the <header>Cache-Control</header> response header field (1.11.10) +for a specified number of seconds after the response became stale, +however, this has lower priority than using the directive parameter. </para> <para>
--- a/xml/en/docs/http/ngx_http_proxy_module.xml +++ b/xml/en/docs/http/ngx_http_proxy_module.xml @@ -10,7 +10,7 @@ <module name="Module ngx_http_proxy_module" link="/en/docs/http/ngx_http_proxy_module.html" lang="en" - rev="55"> + rev="56"> <section id="summary"> @@ -640,7 +640,7 @@ header fields. <para> Determines in which cases a stale cached response can be used -when an error occurs during communication with the proxied server. +during communication with the proxied server. The directive’s parameters match the parameters of the <link id="proxy_next_upstream"/> directive. </para> @@ -649,6 +649,11 @@ The directive’s parameters match the parameters of the The <literal>error</literal> parameter also permits using a stale cached response if a proxied server to process a request cannot be selected. +The same behavior can be enabled with the +“<link url="https://tools.ietf.org/html/rfc5861#section-4">stale-if-error</link>” +extension of the <header>Cache-Control</header> response header field (1.11.10) +for a specified number of seconds after the response became stale, +however, this has lower priority than using the directive parameter. </para> <para id="proxy_cache_use_stale_updating"> @@ -656,6 +661,11 @@ Additionally, the <literal>updating</lit using a stale cached response if it is currently being updated. This allows minimizing the number of accesses to proxied servers when updating cached data. +The same behavior can be enabled with the +“<link url="https://tools.ietf.org/html/rfc5861#section-3">stale-while-revalidate</link>” +extension of the <header>Cache-Control</header> response header field (1.11.10) +for a specified number of seconds after the response became stale, +however, this has lower priority than using the directive parameter. </para> <para>
--- a/xml/en/docs/http/ngx_http_scgi_module.xml +++ b/xml/en/docs/http/ngx_http_scgi_module.xml @@ -10,7 +10,7 @@ <module name="Module ngx_http_scgi_module" link="/en/docs/http/ngx_http_scgi_module.html" lang="en" - rev="30"> + rev="31"> <section id="summary"> @@ -622,6 +622,11 @@ The directive’s parameters match the parameters of the The <literal>error</literal> parameter also permits using a stale cached response if an SCGI server to process a request cannot be selected. +The same behavior can be enabled with the +“<link url="https://tools.ietf.org/html/rfc5861#section-4">stale-if-error</link>” +extension of the <header>Cache-Control</header> response header field (1.11.10) +for a specified number of seconds after the response became stale, +however, this has lower priority than using the directive parameter. </para> <para id="scgi_cache_use_stale_updating"> @@ -629,6 +634,11 @@ Additionally, the <literal>updating</lit using a stale cached response if it is currently being updated. This allows minimizing the number of accesses to SCGI servers when updating cached data. +The same behavior can be enabled with the +“<link url="https://tools.ietf.org/html/rfc5861#section-3">stale-while-revalidate</link>” +extension of the <header>Cache-Control</header> response header field (1.11.10) +for a specified number of seconds after the response became stale, +however, this has lower priority than using the directive parameter. </para> <para>
--- a/xml/en/docs/http/ngx_http_uwsgi_module.xml +++ b/xml/en/docs/http/ngx_http_uwsgi_module.xml @@ -10,7 +10,7 @@ <module name="Module ngx_http_uwsgi_module" link="/en/docs/http/ngx_http_uwsgi_module.html" lang="en" - rev="33"> + rev="34"> <section id="summary"> @@ -622,6 +622,11 @@ The directive’s parameters match the parameters of the The <literal>error</literal> parameter also permits using a stale cached response if a uwsgi server to process a request cannot be selected. +The same behavior can be enabled with the +“<link url="https://tools.ietf.org/html/rfc5861#section-4">stale-if-error</link>” +extension of the <header>Cache-Control</header> response header field (1.11.10) +for a specified number of seconds after the response became stale, +however, this has lower priority than using the directive parameter. </para> <para id="uwsgi_cache_use_stale_updating"> @@ -629,6 +634,11 @@ Additionally, the <literal>updating</lit using a stale cached response if it is currently being updated. This allows minimizing the number of accesses to uwsgi servers when updating cached data. +The same behavior can be enabled with the +“<link url="https://tools.ietf.org/html/rfc5861#section-3">stale-while-revalidate</link>” +extension of the <header>Cache-Control</header> response header field (1.11.10) +for a specified number of seconds after the response became stale, +however, this has lower priority than using the directive parameter. </para> <para>
--- a/xml/ru/docs/http/ngx_http_fastcgi_module.xml +++ b/xml/ru/docs/http/ngx_http_fastcgi_module.xml @@ -10,7 +10,7 @@ <module name="Модуль ngx_http_fastcgi_module" link="/ru/docs/http/ngx_http_fastcgi_module.html" lang="ru" - rev="41"> + rev="42"> <section id="summary"> @@ -620,8 +620,7 @@ server { <context>location</context> <para> -Определяет, в каких случаях можно использовать устаревший закэшированный ответ, -если при работе с FastCGI-сервером возникла ошибка. +Определяет, в каких случаях можно использовать устаревший закэшированный ответ. Параметры директивы совпадают с параметрами директивы <link id="fastcgi_next_upstream"/>. </para> @@ -630,6 +629,11 @@ server { Параметр <literal>error</literal> также позволяет использовать устаревший закэшированный ответ при невозможности выбора FastCGI-сервера для обработки запроса. +Подобное поведение может быть также задано при помощи расширения +“<link url="https://tools.ietf.org/html/rfc5861#section-4">stale-if-error</link>” +поля <header>Cache-Control</header> заголовка ответа (1.11.10) +на определённое количество секунд после того, как ответ стал устаревшим, +но такой способ имеет меньший приоритет, чем задание параметра директивы. </para> <para id="fastcgi_cache_use_stale_updating"> @@ -638,6 +642,11 @@ FastCGI-сервера для обработки запроса. если на данный момент он уже обновляется. Это позволяет минимизировать число обращений к FastCGI-серверам при обновлении закэшированных данных. +Подобное поведение может быть также задано при помощи расширения +“<link url="https://tools.ietf.org/html/rfc5861#section-3">stale-while-revalidate</link>” +поля <header>Cache-Control</header> заголовка ответа (1.11.10) +на определённое количество секунд после того, как ответ стал устаревшим, +но такой способ имеет меньший приоритет, чем задание параметра директивы. </para> <para>
--- a/xml/ru/docs/http/ngx_http_proxy_module.xml +++ b/xml/ru/docs/http/ngx_http_proxy_module.xml @@ -10,7 +10,7 @@ <module name="Модуль ngx_http_proxy_module" link="/ru/docs/http/ngx_http_proxy_module.html" lang="ru" - rev="55"> + rev="56"> <section id="summary"> @@ -640,8 +640,7 @@ server { <para> Определяет, в каких случаях можно использовать -устаревший закэшированный ответ, если при работе с проксированным -сервером возникла ошибка. +устаревший закэшированный ответ. Параметры директивы совпадают с параметрами директивы <link id="proxy_next_upstream"/>. </para> @@ -650,6 +649,11 @@ server { Параметр <literal>error</literal> также позволяет использовать устаревший закэшированный ответ при невозможности выбора проксированного сервера для обработки запроса. +Подобное поведение может быть также задано при помощи расширения +“<link url="https://tools.ietf.org/html/rfc5861#section-4">stale-if-error</link>” +поля <header>Cache-Control</header> заголовка ответа (1.11.10) +на определённое количество секунд после того, как ответ стал устаревшим, +но такой способ имеет меньший приоритет, чем задание параметра директивы. </para> <para id="proxy_cache_use_stale_updating"> @@ -658,6 +662,11 @@ server { если на данный момент он уже обновляется. Это позволяет минимизировать число обращений к проксированным серверам при обновлении закэшированных данных. +Подобное поведение может быть также задано при помощи расширения +“<link url="https://tools.ietf.org/html/rfc5861#section-3">stale-while-revalidate</link>” +поля <header>Cache-Control</header> заголовка ответа (1.11.10) +на определённое количество секунд после того, как ответ стал устаревшим, +но такой способ имеет меньший приоритет, чем задание параметра директивы. </para> <para>
--- a/xml/ru/docs/http/ngx_http_scgi_module.xml +++ b/xml/ru/docs/http/ngx_http_scgi_module.xml @@ -10,7 +10,7 @@ <module name="Модуль ngx_http_scgi_module" link="/ru/docs/http/ngx_http_scgi_module.html" lang="ru" - rev="30"> + rev="31"> <section id="summary"> @@ -611,8 +611,7 @@ server { <context>location</context> <para> -Определяет, в каких случаях можно использовать устаревший закэшированный ответ, -если при работе с SCGI-сервером возникла ошибка. +Определяет, в каких случаях можно использовать устаревший закэшированный ответ. Параметры директивы совпадают с параметрами директивы <link id="scgi_next_upstream"/>. </para> @@ -621,6 +620,11 @@ server { Параметр <literal>error</literal> также позволяет использовать устаревший закэшированный ответ при невозможности выбора SCGI-сервера для обработки запроса. +Подобное поведение может быть также задано при помощи расширения +“<link url="https://tools.ietf.org/html/rfc5861#section-4">stale-if-error</link>” +поля <header>Cache-Control</header> заголовка ответа (1.11.10) +на определённое количество секунд после того, как ответ стал устаревшим, +но такой способ имеет меньший приоритет, чем задание параметра директивы. </para> <para id="scgi_cache_use_stale_updating"> @@ -629,6 +633,11 @@ SCGI-сервера для обработки запроса. если на данный момент он уже обновляется. Это позволяет минимизировать число обращений к SCGI-серверам при обновлении закэшированных данных. +Подобное поведение может быть также задано при помощи расширения +“<link url="https://tools.ietf.org/html/rfc5861#section-3">stale-while-revalidate</link>” +поля <header>Cache-Control</header> заголовка ответа (1.11.10) +на определённое количество секунд после того, как ответ стал устаревшим, +но такой способ имеет меньший приоритет, чем задание параметра директивы. </para> <para>
--- a/xml/ru/docs/http/ngx_http_uwsgi_module.xml +++ b/xml/ru/docs/http/ngx_http_uwsgi_module.xml @@ -10,7 +10,7 @@ <module name="Модуль ngx_http_uwsgi_module" link="/ru/docs/http/ngx_http_uwsgi_module.html" lang="ru" - rev="33"> + rev="34"> <section id="summary"> @@ -610,8 +610,7 @@ server { <context>location</context> <para> -Определяет, в каких случаях можно использовать устаревший закэшированный ответ, -если при работе с uwsgi-сервером возникла ошибка. +Определяет, в каких случаях можно использовать устаревший закэшированный ответ. Параметры директивы совпадают с параметрами директивы <link id="uwsgi_next_upstream"/>. </para> @@ -620,6 +619,11 @@ server { Параметр <literal>error</literal> также позволяет использовать устаревший закэшированный ответ при невозможности выбора uwsgi-сервера для обработки запроса. +Подобное поведение может быть также задано при помощи расширения +“<link url="https://tools.ietf.org/html/rfc5861#section-4">stale-if-error</link>” +поля <header>Cache-Control</header> заголовка ответа (1.11.10) +на определённое количество секунд после того, как ответ стал устаревшим, +но такой способ имеет меньший приоритет, чем задание параметра директивы. </para> <para id="uwsgi_cache_use_stale_updating"> @@ -628,6 +632,11 @@ uwsgi-сервера для обработки запроса. если на данный момент он уже обновляется. Это позволяет минимизировать число обращений к uwsgi-серверам при обновлении закэшированных данных. +Подобное поведение может быть также задано при помощи расширения +“<link url="https://tools.ietf.org/html/rfc5861#section-3">stale-while-revalidate</link>” +поля <header>Cache-Control</header> заголовка ответа (1.11.10) +на определённое количество секунд после того, как ответ стал устаревшим, +но такой способ имеет меньший приоритет, чем задание параметра директивы. </para> <para>