cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject Re: Not caching pages with continuations (was:...where is 304?)
Date Tue, 30 Jan 2007 10:42:15 GMT
Ard Schrijvers wrote:
> Hello,
>> Ard Schrijvers wrote:
>> <snip/>
>>> This is actually almost the same "hack" we used, but 
>> instead of a transformer a selector, and if some value set in 
>> flowscript, an action to set headers. Because we are 
>> outsourcing/other parties using our "best practices", and I 
>> did not want them to have to think about setting things in 
>> flowscript like sessions and values to indicate caching 
>> headers, I chose to "put it in the black box" transformer, 
>> which handles it. Of course, also kind of a hack, because  
>> users aren't really aware of it (certainly because i did not 
>> want another sax transformer, so I did add it to the 
>> StripNameSpaceTransformer which is by default used by us in 
>> front of the serializer. But it does more then its name 
>> suggests, and therefor, it is hacky ofcourse. least 
>> nobody has to think about it :-) ). I wondered if there was a 
>> solid nonhacky solution to the issue....
>> If it's for CForms, we can add the setting of no-cache headers in
>> Form.js since it's very unlikely that a form pipeline will be 
>> cacheable.
> Think we tried similar things (in flowscript), but we found the problem Bertrand also
faced about the fact, that you have to set the headers on the pipeline the serializer is used
from (but all requests for example arrive at a catch all matcher, which does not know wether
it includes a form or not).
> Do you think you can set it globally for the request in Form.js? I tried directly manipulating
the HttpServletResponse, but obviously, this resulted in correct behavior on the first request,
but consecutive cached responses did not have this direct HttpServletResponse manipulation,
so this implied uncacheable pipelines in cocoon, which of course, I did not want either.

Cached responses don't involve the serializer, and this is why the
headers aren't set. On the contrary, the flowscript is always executed,
meaning headers will always correctly been set even if the pipeline it
calls is cacheable (BTW why is this pipeline cacheable at all???)

Also, response.setHeader() is ignored for internal requests. Si if the
flowscript is called through a "cocoon:", headers really have to be set
on the Http request, accessible in the object model with the
HttpEnvironment.HTTP_RESPONSE_OBJECT key.


Sylvain Wallez -

View raw message