PDF Generating Tool Support Forum

HOME   Login   Register    Search




  Subject: Caching policy
   PostPosted: 08 Jun 2010, 02:31 
Hi there,

I am using pd4ml in a web application running on Tomcat. I use the taglibs to generate PDF out of an HTML page.

What is the caching policy of pd4ml in that context ? Is the pd4ml cache (including CSS and images) cleared when tomcat is restarted ? Is the pd4ml cache on the disk or in memory ?

Cheers !


  Subject: Re: Caching policy
   PostPosted: 11 Jun 2010, 14:00 
PD4ML caches images and stylesheets only in memory.

The most recent builds allow to force PD4ML (with an explicit API call) to cache to /tmp directory. All cache files are created with deleteOnExit flag, so in non-fatal situations they are auto-deleted


  Subject: Re: Caching policy
   PostPosted: 01 Jul 2010, 13:36 
Please share us the details of method for local caching, can we specify the location for caching.


  Subject: Re: Caching policy
   PostPosted: 01 Jul 2010, 13:41 
The local caching can be switched on with the following calls.
Map m = new HashMap();
m.put(PD4Constants.PD4ML_CACHE_IMAGES_IN_TMP_DIR, "true");
pd4ml.setDynamicParams(m);

A version, which supports the feature, is going to be released till 9th of July.


  Subject: Re: Caching policy
   PostPosted: 07 Oct 2010, 01:55 
PD4ML wrote:
we have enabled external cache and we could see that the caching is working only in one rendering. i;e; If I use the same image in a sinlgle html file cacheing is working properly. but if the same image is used in another html then cache is not working.
Following is my test case.

I have a html file which i am downloading "HTTPS://WWW.XXX/IMAGES/img1.gif" 20 times with in a single html.
And I am rendering this html 10 times using the JUNit.

I expect the image to be downloaded only once. But the image is being downloaded 10 times(no of times i rendered the html.

Does the caching mechanism works only for each rendering ?




PD4ML wrote:
PD4ML caches images and stylesheets only in memory.

The most recent builds allow to force PD4ML (with an explicit API call) to cache to /tmp directory. All cache files are created with deleteOnExit flag, so in non-fatal situations they are auto-deleted


  Subject: Re: Caching policy
   PostPosted: 23 Oct 2010, 14:52 
Since v361b2 there 2 new API calls: getCache() and setCache(). The methods allow to save and reuse PD4ML cache instance for a case if its static hash tables are aggressively garbage collected by JVM.

Please avoid to use a single cache wrapper instance from a multiple threads simultaneously.



[Reply]     [ 6 posts ] 

Copyright ©2004-10 zefer|org. All rights reserved. Bookmark and Share