You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by ROSSEL Olivier <ol...@airbus.com> on 2002/07/12 11:26:00 UTC

Caching DirectoryGenerator.

I am currently using DirectoryGenerator.
My concern is that it is probably a non-cacheable component, so each time
a request is made, each time a listing of my directory is made.

Of course, files in my directory change once in a century, so the
DirectoryGenerator almost always gives the same result.

If there is no caching system, I would like to make a kind of home-made
caching strategy, using a separate file which timestamp would keep
track of the modification in my directories (== I 'touch' this file
each time I write something in my directories), so I check
this timestamp against the last time the DirectoryGenerator
was accessed, make a test and send a cached DirectoryGenerator result
instead of launching the component.

Is it possible to make that in current architecture?
Is it possible to tune the caching strategy (with actions, for example).

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


RE: Caching DirectoryGenerator.

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: ROSSEL Olivier [mailto:olivier.rossel@airbus.com]
> 
> I am currently using DirectoryGenerator.
> My concern is that it is probably a non-cacheable component, so each
time
> a request is made, each time a listing of my directory is made.
> 
> Of course, files in my directory change once in a century, so the
> DirectoryGenerator almost always gives the same result.
> 
> If there is no caching system, I would like to make a kind of
home-made
> caching strategy, using a separate file which timestamp would keep
> track of the modification in my directories (== I 'touch' this file
> each time I write something in my directories), so I check
> this timestamp against the last time the DirectoryGenerator
> was accessed, make a test and send a cached DirectoryGenerator result
> instead of launching the component.
> 
> Is it possible to make that in current architecture?
> Is it possible to tune the caching strategy (with actions, for
example).

Unfortunately, no.

But you can create CacheableDirectoryGenerator, which is not complex at
all in your case.


PS IIRC, DirectoryGenerator is (or will) being refactored in the 2.1
scratchpad. At least, there were talks about it.


Vadim



---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


RE: Another cashing question .....

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Markus Alin [mailto:markus@swissrisk.com]
> 
> ..... regarding cashing of images.
> 
> I use a SVG image in shape of a piechart which is serialized into a
jpeg and
> displayed in a serialized html page.
> Upon submitting the HTML page with choosen parameters, the same HTML
page
> will be shown again but with different text and a new shape of the SVG
> piechart. However this is not the case while the image seems to be
cashed,
> and only upon clicking the refresh button in the browser the new image
will
> be displayed. Do anyone know how to turn this cashing of images off in
> cocoon 2.

Cocoon 2 can not turn of caching of images in your browser (and, it is
clear from your email, that caching occurs in the browser).

However, you can set some headers using action (try HttpHeaderAction)
which will help you disable browser's cache (and proxy's cache). These
are:

Expires: 0
Pragma: no-cache


Read also about IE:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q234067


PS Is it FAQ?

PPS This answer applies to 2.0.3 and 2.1, but 2.1 will have ability to
set expires header on pipeline level.


Vadim


> Thanx for your help!!
> 
> Regards, Markus
> 
> 
>   _____
> 
> Markus Alin	 tel:	 +41 1 455 70 08
> Swissrisk AG	 fax:	 +41 1 455 70 01
> Räffelstrasse 32	 mobile:	 +41 79 706 58 90
> 8045 Zürich	 mail:	 markus@swissrisk.com
> Switzerland	 home:	 www.swissrisk.com
>   _____


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Another cashing question .....

Posted by Markus Alin <ma...@swissrisk.com>.
..... regarding cashing of images.

I use a SVG image in shape of a piechart which is serialized into a jpeg and
displayed in a serialized html page.
Upon submitting the HTML page with choosen parameters, the same HTML page
will be shown again but with different text and a new shape of the SVG
piechart. However this is not the case while the image seems to be cashed,
and only upon clicking the refresh button in the browser the new image will
be displayed. Do anyone know how to turn this cashing of images off in
cocoon 2.

Thanx for your help!!

Regards, Markus


  _____

Markus Alin	 tel:	 +41 1 455 70 08
Swissrisk AG	 fax:	 +41 1 455 70 01
Räffelstrasse 32	 mobile:	 +41 79 706 58 90
8045 Zürich	 mail:	 markus@swissrisk.com
Switzerland	 home:	 www.swissrisk.com
  _____




---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>