RE: fop-pdf-images and caching

"Simon Steiner" <[email protected]>
Newsgroups gmane.text.xml.fop.user
Message-ID <[email protected]>
Hi,

 

For the change see https://issues.apache.org/jira/browse/FOP-2693

If you cache PDDocument then close is never called on them and you get OOM eventually.

There was a finalize that called close but that wasn’t working on IBM JDK.

I think there were other issues.

 

Thanks

 

From: Matt Kynaston [mailto:[email protected]] 
Sent: 16 November 2017 13:32
To: [email protected]
Subject: Re: fop-pdf-images and caching

 

 

First, I get a hit on the external PDF for each and every page. I've had a look at the PreloadPDF and it looks like it's meant to be caching, but apparently not. Is there some configuration I'm missing for this?

 

Ah hah. Turns out I was looking at the trunk version of fop-pdf-images when I saw the caching stuff. That was removed before version 2.2 was tagged.

 

Going back to ticket FOP-2135 it looks like this "document level" cache was added to reduce the document size, not avoid repeated hits on remote resources. Caching the remote resource is handled by org.apache.xmlgraphics.image.loader.cache.ImageCache, which in turn checks isCachable() on the image. ImagePDF returns false for that :(

 

Does anyone have any insights into this? Is there any way to make a PDF image cacheable?

 

Second, if I rename the external PDF I get an error as expected. However renaming it back doesn't seem to be picked up immediately: it takes one or more runs before it's found again. 

 

Again, this is down to ImageCache, which is keeping track of invalid URLs for 60s.

 

Matt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.