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/05/05 10:54:50 UTC

PDF Image Caching Problem

Hi,

I generate html and pdf, which contain images, from the a database. When 
I update an image the html correctly displays the new image, however the 
pdf incorrectly contains the old image. If I then change the new image 
file name the pdf displays the correct image. When I change the image 
file name back the old image is displayed in the pdf, not the new image.

It appears that the pdf is using a cached version of the image not the 
new version. Please, how can I get the pdf to display the new image 
rather than the old cashed image. I can't change the image file name in 
the production system.

I am using Cocoon 2.1.10

Thank you

Peter Sparkes


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


Re: PDF Image Caching Problem

Posted by Peter Sparkes <pe...@didm.co.uk>.
Hi Mika,

Thanks for the info on open files with the 'noncaching' option. My 
application was crashing every 4 to 5 days and I could not find the 
reason; I got round it by restarting tomcat/cocoon once a day using a 
cron job. I think that I will also leave the image caching problem for 
latter, I have spent enough time on it and restarting cocoon once a day 
means that the pdf catches up with the html within 24 hours which, while 
not ideal, is acceptable

Thank for you help

Peter
> Hi Peter,
>
> unfortunetely I couldn't solve the problem and as it isn't so crucial 
> at the moment, I have left it behind for now on.
>
> Actually there might be another problem (or bug) lying around if you 
> produce htmls' with 'noncaching' option. Cocoon seems to be leaving 
> files open when using html-serializer with noncaching option in your 
> pipeline. And eventually your application can crash because you exceed 
> the maximum open files that your OS tolerates. (Cocoon 2.1.11 / Centos 
> 4.6)
>
> mika
>
> Peter Sparkes kirjoitti:
>> Hi
>>
>> I have tried using  <map:pipeline type="noncaching"> and invalidate 
>> the PDF by changing the XSLT that produces it. Neither makes any 
>> difference.
>>
>> It appears that FOP is getting the image from its own cache which is 
>> not being updated by the new version of the image. Like you I get the 
>> new image when I restart tomcat and hence cocoon
>>
>> Have you managed to fix the problem?
>>
>> Peter
>>> Hi,
>>>
>>> this is what Joerg Heinicke wrote about the similar problem of mine:
>>>
>>> My guess is it's actually the PDF that is taken from the cache. I 
>>> guess the cache key for the PDF does not take included resources 
>>> like your images into account. If that's true you just have to 
>>> invalidate the PDF. I don't know how exactly your PDF pipeline looks 
>>> like but you might want to "touch" (in the Linux sense, changing the 
>>> file's timestamp) an XSLT or the input XML.
>>>
>>> (See: image caching on 4-5 March at the users-list)
>>>
>>> mika
>>>
>>> Peter Sparkes kirjoitti:
>>>> Hi,
>>>>
>>>> I generate html and pdf, which contain images, from the a database. 
>>>> When I update an image the html correctly displays the new image, 
>>>> however the pdf incorrectly contains the old image. If I then 
>>>> change the new image file name the pdf displays the correct image. 
>>>> When I change the image file name back the old image is displayed 
>>>> in the pdf, not the new image.
>>>>
>>>> It appears that the pdf is using a cached version of the image not 
>>>> the new version. Please, how can I get the pdf to display the new 
>>>> image rather than the old cashed image. I can't change the image 
>>>> file name in the production system.
>>>>
>>>> I am using Cocoon 2.1.10
>>>>
>>>> Thank you
>>>>
>>>> Peter Sparkes

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


Re: PDF Image Caching Problem

Posted by "Lehtonen, Mika" <mi...@digikartta.net>.
Hi Peter,

unfortunetely I couldn't solve the problem and as it isn't so crucial at 
the moment, I have left it behind for now on.

Actually there might be another problem (or bug) lying around if you 
produce htmls' with 'noncaching' option. Cocoon seems to be leaving 
files open when using html-serializer with noncaching option in your 
pipeline. And eventually your application can crash because you exceed 
the maximum open files that your OS tolerates. (Cocoon 2.1.11 / Centos 4.6)

mika

Peter Sparkes kirjoitti:
> Hi
>
> I have tried using  <map:pipeline type="noncaching"> and invalidate 
> the PDF by changing the XSLT that produces it. Neither makes any 
> difference.
>
> It appears that FOP is getting the image from its own cache which is 
> not being updated by the new version of the image. Like you I get the 
> new image when I restart tomcat and hence cocoon
>
> Have you managed to fix the problem?
>
> Peter
>> Hi,
>>
>> this is what Joerg Heinicke wrote about the similar problem of mine:
>>
>> My guess is it's actually the PDF that is taken from the cache. I 
>> guess the cache key for the PDF does not take included resources like 
>> your images into account. If that's true you just have to invalidate 
>> the PDF. I don't know how exactly your PDF pipeline looks like but 
>> you might want to "touch" (in the Linux sense, changing the file's 
>> timestamp) an XSLT or the input XML.
>>
>> (See: image caching on 4-5 March at the users-list)
>>
>> mika
>>
>> Peter Sparkes kirjoitti:
>>> Hi,
>>>
>>> I generate html and pdf, which contain images, from the a database. 
>>> When I update an image the html correctly displays the new image, 
>>> however the pdf incorrectly contains the old image. If I then change 
>>> the new image file name the pdf displays the correct image. When I 
>>> change the image file name back the old image is displayed in the 
>>> pdf, not the new image.
>>>
>>> It appears that the pdf is using a cached version of the image not 
>>> the new version. Please, how can I get the pdf to display the new 
>>> image rather than the old cashed image. I can't change the image 
>>> file name in the production system.
>>>
>>> I am using Cocoon 2.1.10
>>>
>>> Thank you
>>>
>>> Peter Sparkes
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org


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


Re: PDF Image Caching Problem

Posted by Peter Sparkes <pe...@didm.co.uk>.
Hi

I have tried using  <map:pipeline type="noncaching"> and invalidate the 
PDF by changing the XSLT that produces it. Neither makes any difference.

It appears that FOP is getting the image from its own cache which is not 
being updated by the new version of the image. Like you I get the new 
image when I restart tomcat and hence cocoon

Have you managed to fix the problem?

Peter
> Hi,
>
> this is what Joerg Heinicke wrote about the similar problem of mine:
>
> My guess is it's actually the PDF that is taken from the cache. I 
> guess the cache key for the PDF does not take included resources like 
> your images into account. If that's true you just have to invalidate 
> the PDF. I don't know how exactly your PDF pipeline looks like but you 
> might want to "touch" (in the Linux sense, changing the file's 
> timestamp) an XSLT or the input XML.
>
> (See: image caching on 4-5 March at the users-list)
>
> mika
>
> Peter Sparkes kirjoitti:
>> Hi,
>>
>> I generate html and pdf, which contain images, from the a database. 
>> When I update an image the html correctly displays the new image, 
>> however the pdf incorrectly contains the old image. If I then change 
>> the new image file name the pdf displays the correct image. When I 
>> change the image file name back the old image is displayed in the 
>> pdf, not the new image.
>>
>> It appears that the pdf is using a cached version of the image not 
>> the new version. Please, how can I get the pdf to display the new 
>> image rather than the old cashed image. I can't change the image file 
>> name in the production system.
>>
>> I am using Cocoon 2.1.10
>>
>> Thank you
>>
>> Peter Sparkes
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>

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


Re: PDF Image Caching Problem

Posted by "Lehtonen, Mika" <mi...@digikartta.net>.
Hi,

this is what Joerg Heinicke wrote about the similar problem of mine:

My guess is it's actually the PDF that is taken from the cache. I guess 
the cache key for the PDF does not take included resources like your 
images into account. If that's true you just have to invalidate the PDF. 
I don't know how exactly your PDF pipeline looks like but you might want 
to "touch" (in the Linux sense, changing the file's timestamp) an XSLT 
or the input XML.

(See: image caching on 4-5 March at the users-list)

mika

Peter Sparkes kirjoitti:
> Hi,
>
> I generate html and pdf, which contain images, from the a database. 
> When I update an image the html correctly displays the new image, 
> however the pdf incorrectly contains the old image. If I then change 
> the new image file name the pdf displays the correct image. When I 
> change the image file name back the old image is displayed in the pdf, 
> not the new image.
>
> It appears that the pdf is using a cached version of the image not the 
> new version. Please, how can I get the pdf to display the new image 
> rather than the old cashed image. I can't change the image file name 
> in the production system.
>
> I am using Cocoon 2.1.10
>
> Thank you
>
> Peter Sparkes
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org


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


RE: PDF Image Caching Problem

Posted by Geert Josten <ge...@daidalos.nl>.
Hi Peter,

I typically use the following construct for non-caching generation of
documents:

    <map:pipeline type="noncaching">
      <map:parameter name="outputBufferSize" value="8192"/>

Kind regards,
Geert

> 
   
 
Drs. G.P.H. Josten
Consultant
 
 

Daidalos BV
Source of Innovation
Hoekeindsehof 1-4
2665  JZ  Bleiswijk
Tel.: +31 (0) 10 850 1200
Fax: +31 (0) 10 850 1199
www.daidalos.nl
KvK 27164984


De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend.
 

> From: Peter Sparkes [mailto:peter@didm.co.uk] 
> Sent: maandag 5 mei 2008 10:55
> To: users@cocoon.apache.org
> Subject: PDF Image Caching Problem
> 
> Hi,
> 
> I generate html and pdf, which contain images, from the a 
> database. When I update an image the html correctly displays 
> the new image, however the pdf incorrectly contains the old 
> image. If I then change the new image file name the pdf 
> displays the correct image. When I change the image file name 
> back the old image is displayed in the pdf, not the new image.
> 
> It appears that the pdf is using a cached version of the 
> image not the new version. Please, how can I get the pdf to 
> display the new image rather than the old cashed image. I 
> can't change the image file name in the production system.
> 
> I am using Cocoon 2.1.10
> 
> Thank you
> 
> Peter Sparkes
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
>

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