Commit 2b1ac1ca authored by Nils Goroll's avatar Nils Goroll

Ref: https://tools.ietf.org/html/rfc7231#section-6.1

Changes:

* 302 Found
* 307 Temporary Redirect

  Do not apply the default ttl, only set a ttl if Cache-Control or Expires are
present.
  Responses with these status codes are not cacheable by default

* 414 Request-URI Too Large

  Cacheable with "heuristic expiration"

https://www.varnish-cache.org/patchwork/patch/251/
parent 1de529dd
......@@ -111,15 +111,18 @@ RFC2616_Ttl(struct busyobj *bo, double now)
default:
expp->ttl = -1.;
break;
case 302: /* Moved Temporarily */
case 307: /* Temporary Redirect */
expp->ttl = -1.;
case 200: /* OK */
case 203: /* Non-Authoritative Information */
case 204: /* No Content */
case 300: /* Multiple Choices */
case 301: /* Moved Permanently */
case 302: /* Moved Temporarily */
case 304: /* Not Modified */
case 307: /* Temporary Redirect */
case 410: /* Gone */
case 304: /* Not Modified - handled like 200 */
case 404: /* Not Found */
case 410: /* Gone */
case 414: /* Request-URI Too Large */
/*
* First find any relative specification from the backend
* These take precedence according to RFC2616, 13.2.4
......
......@@ -32,7 +32,7 @@ varnish v1 -cliok "ban req.url ~ .*"
server s1 {
rxreq
txresp -status 302
txresp -status 301
} -start
varnish v1 -vcl+backend {
......@@ -45,7 +45,7 @@ varnish v1 -vcl+backend {
client c1 {
txreq -url "/"
rxresp
expect resp.status == 302
expect resp.status == 301
expect resp.http.X-varnish == "1007"
} -run
......@@ -54,7 +54,7 @@ delay .1
client c1 {
txreq -url "/"
rxresp
expect resp.status == 302
expect resp.status == 301
expect resp.http.X-varnish == "1010 1008"
} -run
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment