Re: Problems with Driver image cache

2006-01-31 Thread Rolf Bruderer
Jeremias Maerki dev at jeremias-maerki.ch writes:
 See http://xmlgraphics.apache.org/fop/0.20.5/graphics.html#caching on
 how to reset the image cache in FOP 0.20.5 between rendering runs. Note
 that this function is not available anymore in the latest version since
 there the cache works differently. It has much better memory reclaiming
 abilities (using weak references) so a cache reset method should not
 be necessary if you use unique URLs. 

Hi

Thank you very much for the fast answer and your advice how to reset
the cache. That was very helpfull.

Anyway I have to say, that I think that this static image cache is 
not such a good solution (even not with weak references).

 so a cache reset method should not be necessary if you use unique URLs. 

Caching only with respect to the urls without considering if the url 
content has changed inbetween (e.g. modification date) seems not very 
proper to me. 
If done so, the user should at least have a chance to decide whether to
bypass this cache or to empty it. If I understood you right, in the latest
version it is not even possible anymore to empty the cache?

 On the other side, if anyone submits a patch to retrofit this method
 we will surely consider adding it. 

If you give me some hint how to access the cache and if I find some time
I would try to do it. But for the moment I think that I simply stick 
to the older version.

 However, I'd prefer an extension attribute on fo:external-graphic
 that signals FOP to bypass the image cache entirely.

I don't think that changing the fo:external-graphic specification to the
needs of FOP is something that is in your power or is it? 
I don't agree that this attribute would be a good solution. Since a 
writer of a FO-file usualy does not want to concern about cache bypassing.
FOP should better use the correct (cached or reloaded) picture in any case.

Those are just my thoughts about it. In any case I am very thankful for your
help and I appreciate your work. Thank you very much.

Greetz,
rolf


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problems with Driver image cache

2006-01-31 Thread Jeremias Maerki

On 31.01.2006 13:19:50 Rolf Bruderer wrote:
 Jeremias Maerki dev at jeremias-maerki.ch writes:
  See http://xmlgraphics.apache.org/fop/0.20.5/graphics.html#caching on
  how to reset the image cache in FOP 0.20.5 between rendering runs. Note
  that this function is not available anymore in the latest version since
  there the cache works differently. It has much better memory reclaiming
  abilities (using weak references) so a cache reset method should not
  be necessary if you use unique URLs. 
 
 Hi
 
 Thank you very much for the fast answer and your advice how to reset
 the cache. That was very helpfull.
 
 Anyway I have to say, that I think that this static image cache is 
 not such a good solution (even not with weak references).

I'm sure you can come up with suggestions for a much better image cache.
We'd love to apply patches in that direction. Anyway, we plan to add an
environmental class that will hold configuration information that
doesn't change between rendering runs. When this is available I want to
attach the existing image cache to that environmental class. That will
make the image cache less static.

  so a cache reset method should not be necessary if you use unique URLs. 
 
 Caching only with respect to the urls without considering if the url 
 content has changed inbetween (e.g. modification date) seems not very 
 proper to me.

As I said above, we're looking forward to any patches that improve the
current situation.

 If done so, the user should at least have a chance to decide whether to
 bypass this cache or to empty it. If I understood you right, in the latest
 version it is not even possible anymore to empty the cache?

No, not at the moment.

  On the other side, if anyone submits a patch to retrofit this method
  we will surely consider adding it. 
 
 If you give me some hint how to access the cache and if I find some time
 I would try to do it. But for the moment I think that I simply stick 
 to the older version.

Look into org.apache.fop.images.ImageFactory. It should be very easy to
do.

  However, I'd prefer an extension attribute on fo:external-graphic
  that signals FOP to bypass the image cache entirely.
 
 I don't think that changing the fo:external-graphic specification to the
 needs of FOP is something that is in your power or is it? 
 I don't agree that this attribute would be a good solution. Since a 
 writer of a FO-file usualy does not want to concern about cache bypassing.
 FOP should better use the correct (cached or reloaded) picture in any case.

I'm not suggesting altering the FO specs. I'm suggesting an proprietary 
extension
(!) attribute. Something like:

fo:external-graphic src=http://localhost/MyImageServlet; 
fox:bypass-cache=true/
(where fox is xmlns:fox=http://xmlgraphics.apache.org/fop/extensions;)

Usually, the stylesheet-writer knows that an image is not cacheable so
this is actually quite feasible. If you have a better approach that does
not cost a lot of performance because of network roundtrips then I'm all
for it. Another idea could be to add a user-configurable list of URL
patterns that will not be cached by FOP. Also very easy to do.

 Those are just my thoughts about it. In any case I am very thankful for your
 help and I appreciate your work. Thank you very much.

You're welcome. I'm looking forward to your suggestions and patches.


Jeremias Maerki


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]