[Varnish] #786: ESI includes don't follow 301 and 302 redirects
Varnish
varnish-bugs at varnish-cache.org
Mon Mar 7 12:20:35 CET 2011
#786: ESI includes don't follow 301 and 302 redirects
-----------------------------------------------+----------------------------
Reporter: jorgen@… | Owner: phk
Type: defect | Status: closed
Priority: normal | Milestone:
Component: varnishd | Version: 2.1.3
Severity: normal | Resolution: invalid
Keywords: varnishd, esi, redirect, 301, 302 |
-----------------------------------------------+----------------------------
Changes (by phk):
* status: new => closed
* resolution: => invalid
Old description:
> When using <esi:include src="http://localhost/test"> and
> http://localhost/test responds with an HTTP 301 or 302 redirect, the
> content of the 301 or 302 response is included, not the content of the
> resource given in the Location header. This can give results like this:
>
> <body>
> <p>ESI test</p>
> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
> <html><head>
> <title>301 Moved Permanently</title>
> </head><body>
> <h1>Moved Permanently</h1>
> <p>The document has moved <a href="http://localhost/test/">here</a>.</p>
> </body></html>
> </body>
>
> The source in this case was
>
> <body>
> <p>ESI test</p>
> <esi:include src="http://localhost/test">
> </body>
>
> In my opinion, the redirects should be followed. If that causes
> performance loss, it should be possible to configure varnish to turn on
> or off redirect following in ESI includes.
New description:
When using <esi:include src="http://localhost/test"> and
http://localhost/test responds with an HTTP 301 or 302 redirect, the
content of the 301 or 302 response is included, not the content of the
resource given in the Location header. This can give results like this:
<body>
<p>ESI test</p>
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://localhost/test/">here</a>.</p>
</body></html>
</body>
The source in this case was
<body>
<p>ESI test</p>
<esi:include src="http://localhost/test">
</body>
In my opinion, the redirects should be followed. If that causes
performance loss, it should be possible to configure varnish to turn on or
off redirect following in ESI includes.
--
Comment:
I have pondered this one and moved it to the PostTwoShoppingList, because
it is more of a feature request than a bug report (hence the "invalid"
close reason, that just means: "not a bug" in this case).
The way to deal with this, is to do a restart in your VCL.
Handling it behind the scenes will amount to the same thing, and I am not
keen on moving policy decisions from VCL to C code if it can be avoided.
--
Ticket URL: <http://varnish-cache.org/trac/ticket/786#comment:1>
Varnish <http://varnish-cache.org/>
The Varnish HTTP Accelerator
More information about the varnish-bugs
mailing list