cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Curro, Joseph" <>
Subject Cached results for file producer
Date Tue, 21 Mar 2000 22:52:44 GMT

We are using Cocoon 1.6.1 with JRun 2.3.3 and Netscape Enterprise Server
3.62 on Solaris.

We have been experiencing a problem related to caching when selecting a file
through a producer based on ProducerFromFile.   Our goal was to have the
following happen:

	1. Incoming request does not directly refer to a specific XML file.
Instead, the request is intercepted by a Producer that decides, based on
some work, which of several XML files to serve for that request.
	2. Based on results of a back-end routine, an XML file containing a
custom XSP tag is chosen from the file system.
	3. Custom XSP tag is expanded with dynamic data.
	4. XSLT styling is applied and fully assembled document is rendered.

Our problem is that the first file chosen in step #2 is cached, thereby
obviating the role of the producer in future requests.  Cocoon is
dynamically generating Java source code using a file name based on the
original request; after the first request, though, it effectively ignores it
if our producer returns a different file.

For example, let us say that the a user requests find.xml.  Based on our
application logic, our producer can return one of three files: file1.xml,
file2.xml, or file3.xml.  However, the first one to be returned is cached,
which we can clearly see by looking through in the JRun
repository.  So, for example, if file1.xml is the first file to be produced
by a request to find.xml, we can never have file2.xml or file3.xml returned,
regardless of the outcome of our back-end routine.  (NOTE: The structure
returned by our custom XSP tag is NOT cached.)

Is there anyway around this short of losing the benefits of caching?  We
thought about modifying the Cocoon code, so that the JRun repository creates
and uses _file1.class, _file2.class, etc., but we would like to avoid this
if possible.

Any help would be most appreciated.  I apologize in advance if my
explanation of the problem is somewhat muddled.



View raw message