I have this snipped in one of my .js files :
var user = null;
function main( action ) {
cocoon.response.setHeader( "Expires", "-1" );
cocoon.response.setHeader( "Cache-Control", "no-cache" );
cocoon.response.setHeader( "Pragma", "no-cache" );
if ( user == null ) {
loginInternal();
}
invoke( action );
}
This is based on the linotype sample. I add some headers to every flow
invocation response to make the IE not cache the content. It works fine but I
have a problem with continuations. This url:
http://ouzo/nTer/310b3f485d5a0c0a243e3011632a138d38357c38.continue
is still cached. So I need to set cache control headers for these urls too.
I know I can make it in sitemap (via actions) but I would like to have ALL
logic in my flow and use sitemap.xmap only for view rendering.
How can I achieve something like this (pseudo-code of course):
var user = null;
function main( action ) {
cocoon.response.setHeader( "Expires", "-1" );
cocoon.response.setHeader( "Cache-Control", "no-cache" );
cocoon.response.setHeader( "Pragma", "no-cache" );
if ( user == null ) {
loginInternal();
}
if ( isFunction( action ) )
invoke( action );
else if ( isContinuation( action ) )
runContinuation( action );
}
function isFunction( action ) {
return ( this[ action ] != undefined );
}
function isContinuation( action ) {
return endsWith( action, ".continue" );
}
function runContinuation( action ) {
// ????????????
}
lg
--
Leszek Gawron