Opened 6 months ago

Last modified 6 months ago

#2563 closed defect

Does not respect cache-control when using proxy_cache_use_stale updating — at Version 1

Reported by: aminvakil@… Owned by:
Priority: minor Milestone:
Component: documentation Version: 1.22.x
Keywords: Cc: aminvakil@…
uname -a: Linux hostname 4.19.0-25-amd64 #1 SMP Debian 4.19.289-2 (2023-08-08) x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.22.0
built by gcc 8.3.0 (Debian 8.3.0-6)
built with OpenSSL 1.1.1n 15 Mar 2022
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_auth_request_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-cc-opt='-g -O2 -fdebug-prefix-map=/path/to/nginx-1.22.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie'

Description (last modified by aminvakil@…)

We have

proxy_cache_use_stale updating ...

in our proxy configurations, and on some paths, upstream is sending

cache-control: no-cache, no-store, must-revalidate
pragma: no-cache
expires: 0

in a 302 response.

It seems that nginx is caching this sometimes, because some clients are receiving 404 and all of those requests are

cache_status=UPDATING

.

It happens for 1 percent of clients and whenever I try to reproduce this I get

cache_status=EXPIRED

, so I'm not sure how to go further with this.

Change History (1)

comment:1 by aminvakil@…, 6 months ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.