cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Johnston <>
Subject Re: handling burden of multiple firefox request
Date Wed, 04 Oct 2006 13:18:44 GMT
es wrote:
> Hello to all,
> in short:
> I have a ConcurrentModificationException caused by the fact that (only) 
> firefox send out from 2 to 5 request for the same image (generated) 
> file. I've said only since I tested it in konqueror and Opera and both 
> send out only 1 request as httptracer 
> ( shows out in the log (stripped 
> down for readability) I've put here 
> ( look also 
> for opera trace).
> I tried setting the ExpiresCachingProcessingPipeline but I had no change 
> in the result headers. I placed in the same dir 
> the sitemap snipet I'm using and the action used to generate the image.
> How do you guys deal with this? It's the cache approach the right one?
> I wasn't able to find much around in ml or docs about this 
> ExpiresCaching or this specific problem...
> Some background info:
> The pipeline that generate the simple image I whant to serve is made 
> with java2D taking some data out of OpenOffice spreadsheet using the UNO 
> API. This requires time (1/2 sec) and happens through an action (impl. 
> ThreadSafe) that pass a FileSource OutputStream to a dispatcher that is 
> responsible to interact with the backend and generate the image writing 
> out a file being <map:read src="{uri}" mime-type="image/png"/> at the end.
> I know this isn't the best approach and would be nice to not having to 
> write out the file at all and just send to the request OutputStream. How 
> should I do it? Anyway the file should be cacheable isn't it?

It sounds like you should create your own custom Reader, rather than the 
Action that writes its result to a file and gets picked up by the 
standard resource reader.  You should be able to extend AbstractReader 
and copy most of the code over from your Action, and in the generate() 
method you just write the image data directly to the 'out' OutputStream.

The Reader can also implement CacheableProcessingComponent; the getKey() 
method will need to return a unique key for every cacheable result (the 
request URI maybe?), and the getValidity() method can, at its simplest, 
just return an ExpiresValidity.

See for an intro to writing 

> If I can't find a solution using ExpiresCachingProcessingPipeline I 
> should probably check SourceValidity before going on in the action, right?
> let me know if you need more background info and thanks in advance.
> ciao
> Eli
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message