[interchange] Add x_accel_expires pragma to set X-Accel-Expires header
Jon Jensen <[email protected]> Tue, 16 Jan 2018 23:43:09 +0000
| Newsgroups | gmane.comp.web.interchange.cvs |
|---|---|
| Message-ID | <[email protected]> |
commit 6157e62565e7a076db20d76ca2643f3d4d8a53c5 Author: Jon Jensen <[email protected]> Date: Tue Jan 16 16:39:58 2018 -0700 Add x_accel_expires pragma to set X-Accel-Expires header This allows us to have an nginx proxy cache responses for a different length of time than the end client will based on the Cache-Control header. For details see: http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_valid lib/Vend/Server.pm | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) --- diff --git a/lib/Vend/Server.pm b/lib/Vend/Server.pm index 3bb495d..473e47f 100644 --- a/lib/Vend/Server.pm +++ b/lib/Vend/Server.pm @@ -1,6 +1,6 @@ # Vend::Server - Listen for Interchange CGI requests as a background server # -# Copyright (C) 2002-2016 Interchange Development Group +# Copyright (C) 2002-2018 Interchange Development Group # Copyright (C) 1996-2002 Red Hat, Inc. # # This program was originally based on Vend 0.2 and 0.3 @@ -24,7 +24,7 @@ package Vend::Server; use vars qw($VERSION $Has_JSON $RUNDIR); -$VERSION = '2.108'; +$VERSION = '2.109'; use Cwd; use POSIX qw(setsid strftime); @@ -643,6 +643,9 @@ sub get_cache_headers { my $cc = $::Pragma->{cache_control}; push @headers, "Cache-Control: $cc" if $cc; + my $xee = $::Pragma->{x_accel_expires}; + push @headers, "X-Accel-Expires: $xee" if defined($xee) and length($xee); + push @headers, "Pragma: no-cache" if delete $::Scratch->{mv_no_cache}; return @headers;