You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xmlgraphics.apache.org by Jeremias Maerki <de...@jeremias-maerki.ch> on 2009/03/26 18:09:31 UTC

Image Cache: behaviour for failed URIs

I've been made aware that the current way failed URIs are handled in the
image cache may not be ideal: If a URI is only temporarily unavailable,
the image identified by this URI will remain invalid until the JVM is
restarted or the cache is cleared explicitely.

The reason for the failed set is that FOP accesses an image twice for a
single document (FO stage and rendering stage). For a slow connection,
that would slow down the formatter quite a bit.

How about this? Each entry in the failure set gets a time stamp and a
timeout will invalidate the entry, forcing a retry next time the URI is
accessed. The timeout could be set to 0, which would effectively disable
that failed set. A value > 0 would set the timeout to n seconds. And a
negative value equals to infinity which would represent the current
behaviour.

If nobody sees a problem with that I'll implement that shortly.

Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


Re: Image Cache: behaviour for failed URIs

Posted by Chris Bowditch <bo...@hotmail.com>.
Jeremias Maerki wrote:

> I've been made aware that the current way failed URIs are handled in the
> image cache may not be ideal: If a URI is only temporarily unavailable,
> the image identified by this URI will remain invalid until the JVM is
> restarted or the cache is cleared explicitely.
> 
> The reason for the failed set is that FOP accesses an image twice for a
> single document (FO stage and rendering stage). For a slow connection,
> that would slow down the formatter quite a bit.
> 
> How about this? Each entry in the failure set gets a time stamp and a
> timeout will invalidate the entry, forcing a retry next time the URI is
> accessed. The timeout could be set to 0, which would effectively disable
> that failed set. A value > 0 would set the timeout to n seconds. And a
> negative value equals to infinity which would represent the current
> behaviour.

I like this proposal, so +1.

Just to provide some context, imagine you are batch processing 1000 
documents and they all use the same image. If the images are served by a 
remote servlet and a network glitch causes the 500th document to fail to 
retrieve the image then documents 501-1000 will all fail. Really only 
document 500 should fail.

Providing such a configuration setting lets the user decide whether to 
scarifice performance in favour of robustness.

> 
> If nobody sees a problem with that I'll implement that shortly.

Thanks,

Chris




---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org