Hello Sylvain,

you implemented the caching for the DirectoryGenerator in Cocoon 2.1. For the key generation you simply concatenated the string representations of all parameters. But SimpleDateFormat and RE don't have implemented the toString() method and so strings like "[EMAIL PROTECTED]" are returned. But you will get a new key for almost every request, so it's not the way to go I guess.

For the DirectoryGenerator in Cocoon 2.0 I have taken to original passed parameters (not the objects created from them) to generate the key. Can you (or somebody else) have on it there and tell me, if this is the best approach or if it is possible to improve it?

Joerg

[EMAIL PROTECTED] wrote:
joerg 2003/06/21 06:34:04

  Modified:    src/java/org/apache/cocoon/generation
                        DirectoryGenerator.java

...


  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.caching.CacheableProcessingComponent#getKey()
  +     * FIXME: SimpleDateFormat and RE don't have a toString() implemented, so
  +     *        the key generation is buggy!!
  +     */
  +    public Serializable getKey() {
  +        return super.source + this.depth + this.dateFormatter + this.sort
  +               + this.reverse + this.rootRE + this.excludeRE + this.includeRE;
  +    }



Reply via email to