I just skimmed through the mailing list to find ideas of how to cache a
pipeline starting with a request generator and later on passing data
through the SQLTransformer.

Did you or anybody else follow up on this idea?


NB: Caching of the request generator would probably also need to cache
request parameters passed not part as part of the URL. As usually only
some request parameters are used in the pipeline, the sitemap element
might list the request parameters to consider when generating cache key:

<map:generator type="request">
    <map:parameter name="request-data-used" value="input1">
    <map:parameter name="request-data-used" value="input2">
    ...

-------------------------------------------------

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





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

Reply via email to