A couple of things I'd like to do with Cocoon caching; let me know if this
is crazy.

1. Add caching to the request generator.  Many of my pipelines are
transformations based upon the request, and since requestGenerator currently
does not support caching, it means those transformations are always re-done
(and often there is some sql at the end of the pipe which is really slow).
I'd like to hash (or MD5?) the request string and use that as the cache key
so that if I get the same one the pipeline knows it can skip over
everything.

2. Add caching to the SqlTransformer.  I know this sounds weird, but hear me
out.  Our database is modified infrequently, so usually returns the same
data.  There is a datestamp in a special table which indicates when the last
time the database was updated.  The SQL Transformer would remember the time
of the last query.  I would have a new parameter to the sql transformer to
indicate when the data is dirty.

        <map:transform type="sql">
          <map:parameter name="last-update-time"
value="cocoon:/lastUpdateTime.xml"/>
        </map:transform>

LastUpdateTime looks like:

<Date>20021005144321</Date> (Or whatever the xml date format is, I forget).

SQLGenerator would resolve cocoon:/lastUpdateTime.xml.

I would then have a pipeline for lastUpdateTime.xml which would build it by
querying my special table (but if you wanted, you could use some other
mechanism to build it).

SQLGenerator would compare the two dates and re-run the sql if it needed to.

How does this sound?

Steve


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

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to