You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Joerg Heinicke <jo...@gmx.de> on 2005/05/19 21:22:37 UTC

Re: Creative Ideas on How to Cache Pipelines Containing Non-Cacheable Generator?

On 19.01.2005 16:19, David Swearingen wrote:

> I store all my content for a Cocoon site in xml files.  This means I make a
> lot of use of the DirectoryGenerator.  It works great, but I've got now some
> legacy .pdf files from another project, sometimes hundreds per directory,
> sometimes on another machine on the local network, and so it takes several
> seconds to collect the directory contents.  
> 
> I know that DirectoryGenerator doesn't cache, which makes sense for most
> cases.  But what about cases like mine where I know the contents of a
> directory only change once a day at midnight: I don't need to keep pulling
> the directory's contents all day long with every page hit to my site.  I
> need caching of some sort.  I don't mind if the first visitor to my site
> each day has to wait 5 seconds for that page.  But if I could then capture
> that created final page and store it for the rest of the day, that would be
> great.

It is cacheable - it reads/compares the file and directory timestamps. 
Additionally you can set a parameter "refreshDelay" which avoids the 
more or less time consuming timestamp checks and comparisons for this 
period [1].

Furthermore you can even set the caching on the pipeline [2]:
<map:pipeline>
   <map:parameter name="expires" value="access plus 1 minutes"/>
   ...
</map:pipeline>

Joerg

[1] 
http://cocoon.apache.org/2.1/userdocs/generators/directory-generator.html
[2] http://cocoon.apache.org/2.1/userdocs/concepts/caching.html


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