cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ard Schrijvers" <>
Subject RE: Custom Pipeline Caching
Date Mon, 01 May 2006 11:18:57 GMT
I suppose that a generator fetching the external content and a timestamp validity should be
enough: But then again, if its an http request, I am not sure if this really is going to work
(if a timestamp like lastmodified is available through http). But, if you have control over
the external data (ie. it is a repository kind of thing you have), you can use eventCache,
though it is quite complex if you have to implement it from scratch...
Then again, if it is not your data/server, and it really has to be live up-to-date, you fastly
run out of options. And only caching the last part is will only give you some gain if you
have a very large xml file and complex transform (otherwise it will be not the bottleneck
in time anyway, the last tranform)
Regards Ard

Oosteinde 11
1017WT Amsterdam
The Netherlands
Tel  +31 (0)20 5224466
------------------------------------------------------------- / <> 

Well I think in my environment step 2 is the way to go... Creating a timestamp or cache-key
might not be a problem. The only thing might be that the content to fetch is itself initialized
by some transformations and therefore submitted as SAX events, which gives me the problem
that I would need to get access to the pipeline content and beeing able to return my timestamp
during transform...

Is that possible? Sounds not really cocoon-like ;)

I don't want to skip the fetching of the external content because up-to-date data is a strong
requirement in my case. So what I need is a way to skip the following transforms.



Ard Schrijvers schrieb: 

The specific thing you describe you want to implement is not possible. But, there are options
to improve on some points, but it really depends on a few things (especially getting the external
I will try to summarize some of your options here:
1) How up to date should the external content be? Can you say, it is valid for at least 5
minutes? Then, use the expiring cche of cocoon
2) Can you get a timestamp of the external content (just like on filesystem, a lastmodified)?
Then, normal cocoon cache should work. Only disadvantage, is that for checking the validity
of your cached pipeline, a call to the external resource is made for something like a timestamp.
3) This is by far the nicest solution, but probably not useable for you: if you have external
calls to for example a repository, eventCaching is the way to go, where for example after
changes, jms messages invalidate the corresponding pipelines. But, probably, you just read
external content which is not yours.
These are your options I think. 
If you want to understand more about the cocoon caching mechanism, and how cocoon checks for
cached pipelines (especially what the order of checks are, like cache keys and validity objects),
check out:
Regards Ard

Oosteinde 11
1017WT Amsterdam
The Netherlands
Tel  +31 (0)20 5224466
------------------------------------------------------------- / <> 

View raw message