annotate src/misc/ngx_cpp_test_module.cpp @ 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 1d693deab8ae
children f1e6f65ddfeb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2157
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1
5761
1d693deab8ae Style: fix typo.
Piotr Sikora <piotr@cloudflare.com>
parents: 4759
diff changeset
2 // stub module to test header files' C++ compatibility
2157
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
3
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
4 extern "C" {
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
5 #include <ngx_config.h>
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
6 #include <ngx_core.h>
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
7 #include <ngx_event.h>
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
8 #include <ngx_event_connect.h>
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
9 #include <ngx_event_pipe.h>
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
10
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
11 #include <ngx_http.h>
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
12
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
13 #include <ngx_mail.h>
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
14 #include <ngx_mail_pop3_module.h>
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
15 #include <ngx_mail_imap_module.h>
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
16 #include <ngx_mail_smtp_module.h>
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
17 }
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
18
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
19 // nginx header files should go before other, because they define 64-bit off_t
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
20 // #include <string>
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
21
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
22
4759
4c36e15651f7 Fixed compilation with -Wmissing-prototypes.
Ruslan Ermilov <ru@nginx.com>
parents: 2157
diff changeset
23 void ngx_cpp_test_handler(void *data);
4c36e15651f7 Fixed compilation with -Wmissing-prototypes.
Ruslan Ermilov <ru@nginx.com>
parents: 2157
diff changeset
24
2157
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
25 void
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
26 ngx_cpp_test_handler(void *data)
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
27 {
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
28 return;
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
29 }