While investigating the multi-threading issues in the maint-branch I
came across the following:

Currently, in the context of the PDF renderer, every FopImage is closed
as soon as it's written to the target file. The next time the same
image/url is used it has to be reloaded. This is not true for the other
renderers, where the images are really being cached. The calls to
FopImage.close() in PDFXObject are effectively disabling the caching
mechanism. But on the other side it enables the correct working of urls
that deliver dynamic content (only for PDFs), when the same URL can
deliver different content over multiple invocations.

Which brings me to my idea. I don't know if we had that before. Wouldn't
it solve this problem if we defined a proprietary extension for
fo:external-graphic to specify if a given url is not to be cached? The
content-type attribute can obviously not be used for that purpose. How
about this?

<fo:external-graphic src="url(http://localhost/mydynamicimage)" 
xmlns:fop="http://xml.apache.org/fop"; fop:disable-caching="true"/>

Default for disable-caching would be "false".

This could also be useful for the redesign, where we have the same
problem: When can and should we cache an image?

Currently, I'm thinking if I should just delete the FopImage.close()
method, so the behaviour of image handling is the same for all renderers,
but that results in a semantic change for the PDF renderer. To still be
able to serve dynamic images the above would be necessary.

Any thoughts?

Jeremias Maerki


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

Reply via email to