Mailing List Archive

#1766: Provide an access to the request stack for ESI subrequests
#1766: Provide an access to the request stack for ESI subrequests
---------------------------------+-------------------------
Reporter: lisachenko.it@… | Type: enhancement
Status: new | Priority: normal
Milestone: | Component: varnishd
Version: 4.0.3 | Severity: normal
Keywords: ESI, request, stack |
---------------------------------+-------------------------
In some cases, this feature can be very useful with combination of
req.esi_level variable.

For example, to detect Last-Modified date for a page with ESI blocks (we
just update the main response header within sub-responses).

Here is an example:

{{{

req.stack <== Stack of requests and subrequests
req.stack[0] <== Always first, main request
req.stack[req.esi_level-1] <== Parent request for the current ESI sub-
request.

resp.stack <== Stack of responses
resp.stack[0] <== Main response

if (req.esi_level > 0 && (!resp.stack[0].http.Last-Modified ||
resp.stack[0].http.Last-Modified < resp.http.Last-Modified)) {
// Update our main response headers with information about current
response
set resp.stack[0].http.Last-Modified = resp.http.Last-Modified;
}

}}}

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1766>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1766: Provide an access to the request stack for ESI subrequests [ In reply to ]
#1766: Provide an access to the request stack for ESI subrequests
---------------------------------+----------------------
Reporter: lisachenko.it@… | Owner:
Type: enhancement | Status: closed
Priority: normal | Milestone:
Component: varnishd | Version: 4.0.3
Severity: normal | Resolution: invalid
Keywords: ESI, request, stack |
---------------------------------+----------------------
Changes (by daghf):

* status: new => closed
* resolution: => invalid


Comment:

Hi

In Varnish's ESI processing, the headers of the main object are already on
the wire by the time we get around to start handling any of its ESI
includes. So any solution involving editing a parent request header from
an ESI child request simply isn't going to be possible.

Slightly related to this, 4.1 adds a way to pass data from a top level
request down to its ESI children. We've added req_top to VCL, which
provides read-only access to the top level request's req object.

I'll close this ticket now, feel free to start a discussion on the mailing
list if you'd like to follow up.

Regards,
Dag Haavi Finstad

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1766#comment:1>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs