Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #26644

    Hi,

    I am currently evaluating the product and I ran into a chaching issue.
    I use PD4ML with Coldfusion.

    With CFML I generate the HTML and then feed that to a PD4ML object in
    CFSCRIPT:


    pd4ml = createObject(“java”,”org.zefer.pd4ml.PD4ML”);

    No while experimenting with a pdf generation tool, I noticed that my CSS links are not refreshed. The content of the seperate CSS file is being cached.
    Only when I add:
    pd4ml.clearCache();
    does it refresh.

    Is this correct or is this inefficient?

    Thanks,

    Mattijs

    #28743

    Does it mean, the CSS link in your scenario remains the same, but the document, it returns, changes from time to time?

    #28744

    The link to the css stays the same, but the content of the style sheet was altered.
    It def looked as if the CSS content of the file was being casched in memory.

    cheers,

    mattijs

    #28745

    PD4ML does not test if a particular resource (image or stylesheet) has been changed: if it has a cached version – it uses it.

    You may explicitly disable caching with pd4ml.cache.enable=false environment variable, or with a dynamic parameter.

    [language=java:2wg7x71d]Map m = new HashMap();
    m.put(PD4Constants.PD4ML_CACHE_ENABLE, false);
    pd4ml.setDynamicParams(m);[/language:2wg7x71d]

    We’ve just refined clearCache() method in the development build, but as I got it worked for you before.

    Another workaround would be to add a harmless dynamically generated parameter to the stylesheet reference:

    ./styles/main.css?rnd=

    It should distinguish a new stylesheet from ones loaded before. As a drawback of the approach it will accumulate stylesheet versions in the cache. It is not that dramatic, as they are cached as soft references, but anyway it is a good idea to perform clearCache() from time to time.

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

The forum ‘HTML/CSS rendering issues’ is closed to new topics and replies.