cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler" <>
Subject RE: [RT]Cache/proxy friendly HTTP headers
Date Fri, 11 Jan 2002 10:46:48 GMT

Gianugo Rabellino wrote:
> <snip>
> What I'm thinking about is a sort of mod_expires functionality clone:
> mod_expires ( has a
> simple syntax that allows to implement a flexible caching header
> handling. Basically what it can do is set the Expires headers based on
> modifiers acting on the access time (when the resource was requested on
> a one to one basis) or on the modification time (one to many approach).
> This is an example taken from the docs:
> ExpiresByType text/html "access plus 1 month 15 days 2 hours"
> ExpiresByType image/gif "modification plus 5 hours 3 minutes"
> This is incredibly powerful when applied to real life scenarios, and I'd
> really love to see this feature in Cocoon. But what are the best
> semantics for it? The first thing that comes to my mind is that the
> directive should be an attribute, not an element. If we also consider
> that it might be hard to get and calculate a modification time for
> resources that make up a pipeline, I wouldn't bother about it and base
> all the system on the access time or on absolute time, using a plain
> syntax like "2h5m" or "25feb2002" for expressing the expires validity
> together with some keywords like "never" or "always".

In fact this is something which can speed up cocoon.

Now this proposal has something to do with caching. We already have the
pipeline components: the stream pipeline and the event pipeline which
can be configured to cache or to not cache.

By specifying the expires date on the pipeline element in the sitemap,
you show that the expires configuration might be a configuration of a

And this reminds me of an old proposal originally posted by Giacomo:

Using different pipeline components (currently caching and non caching
in the sitemap, a configuration in the cocoon.xconf(!) would look like this:

  <pipeline name="caching">
    <stream-pipeline src="CachingStreamPipeline"/>
    <event-pipeline src="CachingEventPipeline"/>

  <pipeline name="non-caching">
    <stream-pipeline src="NonCachingStreamPipeline"/>
    <event-pipeline src="NonCachingEventPipeline"/>


In the sitemap, this would look like this:
<map:pipeline name="caching">

So, one possibility to achieve the thing you propose is configuring the
expires also in the cocoon.xconf, for example:
  <pipeline name="caching-and-expires-after-1-day">
    <stream-pipeline src="CachingStreamPipeline">
      <expires after="1 day"/>
    <event-pipeline src="CachingEventPipeline"/>

This would of course end up in a configuration nightmare. Another
possibility would be to make such a stream pipeline configurable in
the pipelines section of the sitemap:

<map:pipeline name="caching">
   <map:parameter name="expires" value="after 1 day"/>


So parameters would be passed on to the stream pipeline object which
could in turn set the corresponding http headers.

What do think about this?


To unsubscribe, e-mail:
For additional commands, email:

View raw message