You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Peter Sparkes <pe...@didm.co.uk> on 2008/08/07 13:27:18 UTC

Image caching problem using FOP

Hi,

I have pages that can be viewed as xhtml and pdf which is generated by 
FOP. When I change the images, using the same image filenames, the new 
images appear in the xhtml version, however the old images are shown in 
the pdf version. If  I use new images with different file names the new 
images appear  in the PDF. However as I am generating the image file 
names programmatically I have to keep the old names.

I am using

<map:pipeline type="noncaching">

If appears that FOP is caching the images somewhere, however I don't 
know how to find and delete the FOP cache

Help please

Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Image caching problem using FOP

Posted by Peter Sparkes <pe...@didm.co.uk>.
Thanks Andy,

Now working

Thanks again

Peter
> 2008/8/7 Peter Sparkes <pe...@didm.co.uk>:
>   
>> I have pages that can be viewed as xhtml and pdf which is generated by FOP.
>> When I change the images, using the same image filenames, the new images
>> appear in the xhtml version, however the old images are shown in the pdf
>> version. If  I use new images with different file names the new images
>> appear  in the PDF. However as I am generating the image file names
>> programmatically I have to keep the old names.
>>     
>
> It's a FOP "feature".  From http://xmlgraphics.apache.org/fop/0.94/graphics.html
> "FOP caches images between runs. There is one cache per FopFactory
> instance. The URI is used as a key to identify images which means that
> when a particular URI appears again, the image is taken from the
> cache. If you have a servlet that generates a different image each
> time it is called with the same URL you need to use a constantly
> changing dummy parameter on the URL to avoid caching."
>
> Like the man said, add a dummy request parameter to the URI with some
> unique value e.g. a hash of the session ID and current time.
>
>
> Andy.
>   
> ------------------------------------------------------------------------
>
>
> No virus found in this incoming message.
> Checked by AVG. 
> Version: 8.0.100 / Virus Database: 270.5.12/1597 - Release Date: 07/08/2008 05:54
>   


Re: Image caching problem using FOP

Posted by Andy Stevens <in...@googlemail.com>.
2008/8/7 Peter Sparkes <pe...@didm.co.uk>:
> I have pages that can be viewed as xhtml and pdf which is generated by FOP.
> When I change the images, using the same image filenames, the new images
> appear in the xhtml version, however the old images are shown in the pdf
> version. If  I use new images with different file names the new images
> appear  in the PDF. However as I am generating the image file names
> programmatically I have to keep the old names.

It's a FOP "feature".  From http://xmlgraphics.apache.org/fop/0.94/graphics.html
"FOP caches images between runs. There is one cache per FopFactory
instance. The URI is used as a key to identify images which means that
when a particular URI appears again, the image is taken from the
cache. If you have a servlet that generates a different image each
time it is called with the same URL you need to use a constantly
changing dummy parameter on the URL to avoid caching."

Like the man said, add a dummy request parameter to the URI with some
unique value e.g. a hash of the session ID and current time.


Andy.
-- 
http://pseudoq.sourceforge.net/  Open source java Sudoku solver

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Image caching problem using FOP

Posted by Peter Sparkes <pe...@didm.co.uk>.
I am using

<fo:external-graphic src=
> Hi,
>
> I have pages that can be viewed as xhtml and pdf which is generated by 
> FOP. When I change the images, using the same image filenames, the new 
> images appear in the xhtml version, however the old images are shown 
> in the pdf version. If  I use new images with different file names the 
> new images appear  in the PDF. However as I am generating the image 
> file names programmatically I have to keep the old names.
>
> I am using
>
> <map:pipeline type="noncaching">
>
> If appears that FOP is caching the images somewhere, however I don't 
> know how to find and delete the FOP cache
>
> Help please
>
> Peter
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> ------------------------------------------------------------------------
>
>
> No virus found in this incoming message.
> Checked by AVG. 
> Version: 8.0.100 / Virus Database: 270.5.12/1597 - Release Date: 07/08/2008 05:54
>