HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML v3 Archived Forums (Read Only) › General questions / FAQ › Caching policy
- This topic has 5 replies, 3 voices, and was last updated Oct 23, 2010
12:52:57 byPD4ML.
-
AuthorPosts
-
June 8, 2010 at 00:31#26373
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 !
June 11, 2010 at 12:00#27966PD4ML 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
July 1, 2010 at 11:36#27967Please share us the details of method for local caching, can we specify the location for caching.
July 1, 2010 at 11:41#27968The local caching can be switched on with the following calls.
[language=java:3k1qn9jp]Map m = new HashMap();
m.put(PD4Constants.PD4ML_CACHE_IMAGES_IN_TMP_DIR, “true”);
pd4ml.setDynamicParams(m);[/language:3k1qn9jp]
A version, which supports the feature, is going to be released till 9th of July.October 6, 2010 at 23:55#27969@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
October 23, 2010 at 12:52#27970Since 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.
-
AuthorPosts
The forum ‘General questions / FAQ’ is closed to new topics and replies.
