annotate docs/text/LICENSE @ 7702:7015f26aef90

Cache: ignore stale-if-error for 4xx and 5xx codes. Previously the stale-if-error extension of the Cache-Control upstream header triggered the return of a stale response for all error conditions that can be specified in the proxy_cache_use_stale directive. The list of these errors includes both network/timeout/format errors, as well as some HTTP codes like 503, 504, 403, 429 etc. The latter prevented a cache entry from being updated by a response with any of these HTTP codes during the stale-if-error period. Now stale-if-error only works for network/timeout/format errors and ignores the upstream HTTP code. The return of a stale response for certain HTTP codes is still possible using the proxy_cache_use_stale directive. This change also applies to the stale-while-revalidate extension of the Cache-Control header, which triggers stale-if-error if it is missing. Reported at http://mailman.nginx.org/pipermail/nginx/2020-July/059723.html.
author Roman Arutyunyan <arut@nginx.com>
date Wed, 29 Jul 2020 13:28:04 +0300
parents f56a4c91b303
children 61d0df8fcc7c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
450
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1 /*
7447
f56a4c91b303 Year 2019.
Maxim Konovalov <maxim@nginx.com>
parents: 7187
diff changeset
2 * Copyright (C) 2002-2019 Igor Sysoev
f56a4c91b303 Year 2019.
Maxim Konovalov <maxim@nginx.com>
parents: 7187
diff changeset
3 * Copyright (C) 2011-2019 Nginx, Inc.
4753
808dee4f2b22 Synchronized the license text with the FreeBSD's bsd-style-copyright.
Ruslan Ermilov <ru@nginx.com>
parents: 4412
diff changeset
4 * All rights reserved.
450
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
5 *
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
6 * Redistribution and use in source and binary forms, with or without
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
7 * modification, are permitted provided that the following conditions
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
8 * are met:
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
9 * 1. Redistributions of source code must retain the above copyright
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
10 * notice, this list of conditions and the following disclaimer.
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
11 * 2. Redistributions in binary form must reproduce the above copyright
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
12 * notice, this list of conditions and the following disclaimer in the
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
13 * documentation and/or other materials provided with the distribution.
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
14 *
4753
808dee4f2b22 Synchronized the license text with the FreeBSD's bsd-style-copyright.
Ruslan Ermilov <ru@nginx.com>
parents: 4412
diff changeset
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
450
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
16 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
4753
808dee4f2b22 Synchronized the license text with the FreeBSD's bsd-style-copyright.
Ruslan Ermilov <ru@nginx.com>
parents: 4412
diff changeset
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
450
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
25 * SUCH DAMAGE.
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
26 */