Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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 !

    #27966

    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

    #27967

    Please share us the details of method for local caching, can we specify the location for caching.

    #27968

    The 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.

    #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

    #27970

    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.

Viewing 6 posts - 1 through 6 (of 6 total)

The forum ‘General questions / FAQ’ is closed to new topics and replies.