cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <>
Subject Re: [c2] stylesheet and logicsheet parameters
Date Mon, 16 Apr 2001 13:06:41 GMT
Donald Ball wrote:
> On Sun, 15 Apr 2001, giacomo wrote:
> > How would you do that, I don't see it?
> if my stylesheet depends on the value of a cookie named 'foo' (which can
> have 'x' different values, say) and the value of a request parameter named
> 'bar' (which can have 'y' different values), then the cache for this
> component is increased by, at most, x*y.

Ok. So you are saying that if cookie "foo" has 10 different values and
request parameter "bar" can have 100 different values, then we will have
1000 different cache entries for this one (1) stylesheet.  It also means
that we have n/1000 (where n is the number of already cached entries) chance
of hitting the cache.  We also have (1000-n)/1000 chance of missing the

Hmmm.  Now lets throw in request parameter "foobar" that can have an
undefined or infinite number of values.  At this point, cache is pointless,
and we have allowed this to happen if we parameterize the transformer.

We can draw another real world example:

We want to alter our transformation based on country and province/state
(assuming all countries have an equivalent).  So there are >=130 country
codes, US has 50 states and ~3 "territories" (Guam, Puerto Rico, etc),
Canada has ~5 provinces.  If these are kept in two different variables,
then we will have (with just US and Canada defined) 130 * 58 entries.
That's 7,540 entries for one stylesheet.  We will have over 10,000 entries
by the time we are done.  The cache will grow to such a size that it will
be cheaper and more scalable just to freshly generate the page every time.

Let's put that in a pooled environment like the announcement made earlier
and you have two machines with four instances of Tomcat running.  On each
machine you would have to have over 40,000 entries for the one stylesheet.
Can you imagine the overhead in RAM?

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

View raw message