Sylvain Wallez wrote:
Vadim Gritsenko wrote:
Sylvain Wallez wrote:
Moreover, you may consider the case of complex pipelines where the actual template depends on the user rights, target browser or whatever else. In that case, the cache information can be different depending on used template.
And for caching to play right with proxies and browsers, Vary header (and/or some others) should be set. What mechanism can be used to set headers from the JX template?
<jx:var name="foo" value="cocoon.request.setHeader('bar', 'baz')"/> ??
Thought a bit about it... Due to streaming nature of the Cocoon (forget for a second that pipeline's default behavior is to buffer output - default can be changed anyway), this won't work. First startElement() event corresponding to root element is already out, and, under ideal conditions, already written to the output stream.
Thus, this will fail.
The only other option I see is to mimic XSP page structure: Introduce root <jx:page/> tag which is *not* printed to the output. Then, everything between the <jx:page/> and first SAX event can perform whatever setup operations needed.
Vadim
