You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by John Gilbertson <jg...@liverpool.ac.uk> on 2002/05/03 10:56:11 UTC

Caching of external documents

I'm trying to link Cocoon with Zope, to take advantage of all of Zope's
CMS features and interface etc, but havin git output XML for use in
cocoon to produce nicely formatted web-pages, with the option of
converting them to .rtf .pdf or whatever should people desire.

However, I'm havin gproblems persuading Cocoon to check for
modifications to the external .xml file each time the page is requested.
>From what I can tell with using netcat -l -p 4567 on one machine and
pretending to be a webserver, and gettign cocoon to use that as it's
remote source of xml file, that even if the page is different to the one
in it's cache, it still uses the cached version.. even if it's over 12
hours old.
Here's the thing from the sitemap.xmlap:

   <map:match pattern="John/zope.html">
    <map:generate src="http://www.compsoc.man.ac.uk:4567/foo.xml"/>
    <map:transform src="John/zope2html.xsl"/>
    <map:serialize type="html"/>
   </map:match>

The cached version i's using was me trying in work yesterday.. this
morning it's still using that cached version, even though it's
requesting the file each time I request the page from it.

Cocoon version is xml-cocoon2_20020501042034.tar.gz, as I have yet to
find a release version fo cocoon which will compile straight out of the
box on our solars28 systems with Java 1.4.0. Yet I've never had a
problem with the one line compile and install script for any of the CVS
versions...
Tomact version is 4.0.3 release.

Any ideas on how to make cocoon actually take notice fo the remote file
being different?

	John


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: Caching of external documents

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: John Gilbertson [mailto:jgilbert@liverpool.ac.uk]
> 
> On Fri, 3 May 2002, Vadim Gritsenko wrote:
> 
> >> The cached version it's using was me trying in work yesterday..
this
> >> morning it's still using that cached version, even though it's
> >> requesting the file each time I request the page from it.
> >
> >Check last modified time in the HTTP response of your
> >www.compsoc.man.ac.uk server. Cocoon will use cached version if
server
> >reports that file was not modified. See Cocoon's URLSource.java,
> >getLastModified method.
> 
> Unfortunately, the Zope server doesn't seem to return a last-modified
> header with a page. Does this mean that Cocoon will always assume that
> it's not modified, without checking the contents?

Cocoon will assume that it is always modified, and this effectively
disables any caching.


> Barring editing the source, is it possible to put some directive
> somewhere saying re-get it no matter what?

Comment out getLastModified() method in URLSource - default
implementation always returns 0 meaning that no last modification date
known.

Vadim

 
> --
> John Gilbertson


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: Caching of external documents

Posted by John Gilbertson <jg...@liverpool.ac.uk>.
On Fri, 3 May 2002, Vadim Gritsenko wrote:

>> The cached version it's using was me trying in work yesterday.. this
>> morning it's still using that cached version, even though it's
>> requesting the file each time I request the page from it.
>
>Check last modified time in the HTTP response of your
>www.compsoc.man.ac.uk server. Cocoon will use cached version if server
>reports that file was not modified. See Cocoon's URLSource.java,
>getLastModified method.

Unfortunately, the Zope server doesn't seem to return a last-modified
header with a page. Does this mean that Cocoon will always assume that
it's not modified, without checking the contents?
Barring editing the source, is it possible to put some directive
somewhere saying re-get it no matter what?

-- 
John Gilbertson


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: Caching of external documents

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: John Gilbertson [mailto:jgilbert@liverpool.ac.uk]
> 
> I'm trying to link Cocoon with Zope, to take advantage of all of
Zope's
> CMS features and interface etc, but havin git output XML for use in
> cocoon to produce nicely formatted web-pages, with the option of
> converting them to .rtf .pdf or whatever should people desire.
> 
> However, I'm havin gproblems persuading Cocoon to check for
> modifications to the external .xml file each time the page is
requested.
> From what I can tell with using netcat -l -p 4567 on one machine and
> pretending to be a webserver, and gettign cocoon to use that as it's
> remote source of xml file, that even if the page is different to the
one
> in it's cache, it still uses the cached version.. even if it's over 12
> hours old.
> Here's the thing from the sitemap.xmlap:
> 
>    <map:match pattern="John/zope.html">
>     <map:generate src="http://www.compsoc.man.ac.uk:4567/foo.xml"/>
>     <map:transform src="John/zope2html.xsl"/>
>     <map:serialize type="html"/>
>    </map:match>
> 
> The cached version i's using was me trying in work yesterday.. this
> morning it's still using that cached version, even though it's
> requesting the file each time I request the page from it.

Check last modified time in the HTTP response of your
www.compsoc.man.ac.uk server. Cocoon will use cached version if server
reports that file was not modified. See Cocoon's URLSource.java,
getLastModified method.


> Cocoon version is xml-cocoon2_20020501042034.tar.gz, as I have yet to
> find a release version fo cocoon which will compile straight out of
the
> box on our solars28 systems with Java 1.4.0. Yet I've never had a
> problem with the one line compile and install script for any of the
CVS
> versions...
> Tomact version is 4.0.3 release.
> 
> Any ideas on how to make cocoon actually take notice fo the remote
file
> being different?
> 
> 	John


Vadim

--
Resistance is futile.


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>