Opened 11 years ago

Last modified 2 years ago

#407 new enhancement

Cache X-Accel-Redirect responses (from fastcgi)

Reported by: Jille Timmermans Owned by:
Priority: minor Milestone:
Component: nginx-module Version: 1.1.x
Keywords: Cc:
uname -a: Linux sholazar 3.2.0-49-generic #75-Ubuntu SMP Tue Jun 18 17:39:32 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.1.19
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-log-path=/var/log/nginx/access.log --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid --with-debug --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_realip_module --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module --with-http_xslt_module --with-ipv6 --with-sha1=/usr/include/openssl --with-md5=/usr/include/openssl --with-mail --with-mail_ssl_module --add-module=/build/buildd/nginx-1.1.19/debian/modules/nginx-auth-pam --add-module=/build/buildd/nginx-1.1.19/debian/modules/nginx-echo --add-module=/build/buildd/nginx-1.1.19/debian/modules/nginx-upstream-fair --add-module=/build/buildd/nginx-1.1.19/debian/modules/nginx-dav-ext-module

Description

I've got a FastCGI (PHP-FPM) backend-server which will do some preprocessing and return an X-Accel-Redirect header to tell nginx to serve the file. I would like nginx to cache this response; not the actual response to the client but just the mapping from $request_uri to the headers returned by FPM. On subsequent requests nginx could get that reply from the cache without bothering FPM and resolve the X-Accel-Redirect and serve the file.

(In my case I would like to use X-Accel-Expires to tell nginx it can cache the request.)

Change History (1)

comment:1 by Maxim Dounin, 2 years ago

See also #2189.

Note: See TracTickets for help on using tickets.