Opened 4 years ago

Last modified 4 years ago

#2048 assigned defect

Document that 'proxy_buffering off' disables caching

Reported by: peter.volkov@… Owned by: Yaroslav Zhuravlev
Priority: minor Milestone:
Component: documentation Version: 1.19.x
Keywords: Cc:
uname -a: Linux hostname 4.19.8-gentoo #1 SMP Fri Dec 14 09:04:12 -00 2018 x86_64 Intel(R) Xeon(R) CPU E5-2630 v4 @ 2.20GHz GenuineIntel GNU/Linux
nginx -V: nginx version: nginx/1.17.5
built with OpenSSL 1.1.1d 10 Sep 2019
TLS SNI support enabled
configure arguments: --prefix=/usr --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error_log --pid-path=/run/nginx.pid --lock-path=/run/lock/nginx.lock --with-cc-opt=-I/usr/include --with-ld-opt=-L/usr/lib64 --http-log-path=/var/log/nginx/access_log --http-client-body-temp-path=/var/lib/nginx/tmp/client --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --with-compat --with-http_v2_module --with-pcre --without-http_grpc_module --without-http_ssi_module --without-http_upstream_hash_module --without-http_upstream_zone_module --with-http_flv_module --with-http_geoip_module --with-http_mp4_module --with-http_realip_module --with-http_secure_link_module --with-http_stub_status_module --with-http_realip_module --add-module=external_module/headers-more-nginx-module-0.33 --add-module=external_module/nginx_upstream_check_module-9aecf15ec379fe98f62355c57b60c0bc83296f04 --add-module=external_module/nginx-push-stream-module-0.5.4 --add-module=external_module/ngx_http_geoip2_module-3.2 --with-http_ssl_module --without-stream_access_module --without-stream_geo_module --without-stream_limit_conn_module --without-stream_map_module --without-stream_return_module --without-stream_split_clients_module --without-stream_upstream_hash_module --without-stream_upstream_least_conn_module --without-stream_upstream_zone_module --without-mail_imap_module --without-mail_pop3_module --without-mail_smtp_module --user=nginx --group=nginx

Description

If we disable proxy_buffering it will disable caching in nginx. Why is that? I've spent an enormous amount of time to debug this problem while there is no mention of that anywhere in the documentation. Only after I've managed to localize this option (by enabling/disabling random options) I've realised what cases this and found that this was documented in
https://trac.nginx.org/nginx/ticket/849#comment:1
and
https://stackoverflow.com/questions/9230812/nginx-as-cache-proxy-not-caching-anything

Still, I think such information should be mentioned in the documentation.

TIA.

Change History (2)

comment:1 by peter.volkov@…, 4 years ago

BTW I think it's worth site here comments from stackoverflow:

Made my day. I've spent 3 days! To figure out what the wrong with our config. Big, great thank you @Overbryd , from bottom of my heart. – dr.dimitru Apr 3 '16 at 13:37

@Overbryd gj! was fighting nginx for 2 days, and your answers is freaking awesome! – Bubonic Pestilence Dec 7 '16 at 10:47

wth - this is not mentioned in ANY caching example on the web that I've found after 3 hours of searching! – HDave Dec 29 '16 at 5:05

comment:2 by Maxim Dounin, 4 years ago

Owner: set to Yaroslav Zhuravlev
Status: newassigned

Yaroslav, please take a look. Something like a "Caching and storing responses to disk only only works if buffering is enabled" note should improve things (see proxy_limit_rate and proxy_max_temp_file_size for some related text).

Note: See TracTickets for help on using tickets.