You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Giacomo Pati <Gi...@pwr.ch> on 2000/08/01 09:45:06 UTC

Re: Is Cocoon2 caching implemented?

On Mon, Jul 31, 2000 at 05:24:53PM -0400, Berin Loritsch wrote:
> I was evaluating performance, and if the pages are being generated
> every time, the numbers I get are kosher.
> 
> Basically, my pages are being generated between 100ms and 390ms
> depending on load.  Considering I am running an Athlon 700 and
> IBM's JDK 1.3, these are respectable times for the initial page
> creation.
> 
> If caching is implemented/enabled, then these times are way
> too much.  In Cocoon1, Tomcat/Cocoon returns them from cache in
> less than 1ms on my machine.

Cache? What's a cache? :))

Seriously, there is no cache implemented. every page undergoes the same generation steps.

Giacomo

-- 
PWR GmbH, Organisation & Entwicklung      Tel:   +41 (0)1 856 2202
Giacomo Pati, CTO/CEO                     Fax:   +41 (0)1 856 2201
Hintereichenstrasse 7                     Mailto:Giacomo.Pati@pwr.ch
CH-8166 Niederweningen                    Web:   http://www.pwr.ch


Re: Is Cocoon2 caching implemented?

Posted by Jon Lancelle <jk...@knosys.com>.
Very nice!!!



Berin Loritsch wrote:

> Jon Lancelle wrote:
> >
> > Do you think such an implementation will eventually be a part of Cocoon 2?
>
> I'm positive, it is a matter of time.
>
> For non-dynamic pages we have more than 100-fold performance increase for
> the reward--definitely worth it.

Re: [Cocoon Devel]Is Cocoon2 caching implemented?

Posted by Berin Loritsch <bl...@infoplanning.com>.
Brian May wrote:
> 
> >>>>> "Berin" == Berin Loritsch <bl...@infoplanning.com> writes:
> 
>     Berin> Jon Lancelle wrote:
>     >> Do you think such an implementation will eventually be a part
>     >> of Cocoon 2?
> 
>     Berin> I'm positive, it is a matter of time.
> 
>     Berin> For non-dynamic pages we have more than 100-fold
>     Berin> performance increase for the reward--definitely worth it.
> 
> What is the plan for static files? According to the documentation, I
> have read "To be able to put most of the static part job back on the
> web server (where it belongs), Cocoon2 will greatly improve it's
> command line operation, allowing the creation of site makefiles that
> will automatically scan the web site and the source documents and will
> provide a way to regenerate the static part of a web site (images and
> tables included!) based on the same XML model used in the dynamic
> operation version."
> 
> However, wouldn't this make caching redundant?

You are mixing the view for dynamic and static HTML.  Part of that is
my fault for saying non-dynamic.  I was trying to convey that the XML
is still transformed by Cocoon--therefore Cocoon handles the caching.
For static HTML, the onus is on the web server to cache the pages.

Cocoon will have the ability to generate the HTML from your sitemap,
and let the web browser deal with the caching _if_you_choose_to_do_so_.
At least this is my understanding.

> Personally, my major concern for Cocoon 1 (and so far Cocoon 2), is
> that static web pages do not have the http "Last-Modified"
> header. This means that proxy http caches like squid will not cache
> the page, meaning it has to be re-down-loaded every time you access
> it, even if you only accessed it five minutes ago...

Hmmm.  Good point.  The Last-Modified and Expires headers should both be
used.

> I hope that one day, Cocoon2 will be able to create static HTML files
> (where practical), so that the web-server is responsible for
> generating these headers again.

This is the general plan.

> Then again, I have encountered this problem even for
> http://xml.apache.org/. It was my impression that this web site used
> static HTML pages???

It does.

Re: [Cocoon Devel]Is Cocoon2 caching implemented?

Posted by Stuart Roebuck <sr...@adolos.com>.
>Yes, xml.apache.org is batch generated and this sucks big time since we
>can't make stylebook run on xml.apache.org since no good Java 1.2 JVM is
>(yet) available for FreeBSD....

Just a thought, but MacOS X Beta should be around by the end of 
September.  It's very close to FreeBSD and has a good post 1.2 JVM 
already in the developer release.  You might want to consider it as 
an alternative server option!

I'm certainly having no-problems at all with the Coocon et. al. on MacOS X DP4.

Stuart.
-- 
---------------------------------------------------------------------------
                 Stuart Roebuck, Managing Director, ADOLOS
    Tel. 0131 228 4853      Fax. 0870 054 8322      http://www.adolos.com
               Pager  07654 588 898 (100 char alphanumeric)
         For secure communication use my personal PGP Public Key:
  PGP Fingerprint - 801F 1FBD D568 98AA A90D  CEB2 6CEF 046B 23BA FAC9

Re: Is Cocoon2 caching implemented?

Posted by Stefano Mazzocchi <st...@apache.org>.
Brian May wrote:
> 
> >>>>> "Stefano" == Stefano Mazzocchi <st...@apache.org> writes:
> 
>     >> Personally, my major concern for Cocoon 1 (and so far Cocoon
>     >> 2), is that static web pages do not have the http
>     >> "Last-Modified" header.
> 
>     Stefano> This is a matter or writing a new serialier (or improving
>     Stefano> on existing ones) that is able to do this... there is
>     Stefano> nothing in the C2 architecture that doesn't allow you to
>     Stefano> do that.
> 
> I think the hardest part might be knowing
> 
> 1. what "last modified" header to use.
> 
> 2. Also when to use the "expires" header (dynamic pages should expire)
> might be an issue.
> 
> I am guessing that 2 could be specified in the sitemap, however 1,
> might be harder. You could have the last-modified date of the XML
> file:
> 
> last-modified(out.html) = last-modified(in.xml)
> 
> or the XSL file:
> 
> last-modified(out.html) = last-modified(in.xsl)
> 
> Or perhaps something like:
> 
> last-modified(out.html) = max(last-modified(in.xml),last-modified(in.xsl))
> 
> would be more appropriate? I am assuming it is easy enough to obtain
> the last-modified(in.xml) and last-modified(in.xsl) in the serializer
> layer?

Hmmm, I agree we should spend more thoughts on this...
 
>     Stefano> ... anyway, using a CVS generator and a proxy friendly
>     Stefano> serializer could allow us to update the site directly
>     Stefano> without having to touch anything, just trusting CVS
>     Stefano> security and all documentation would be reflected
>     Stefano> directly to the proxy (if modified from internal Cocoon
>     Stefano> cache).
> 
>     Stefano> Wouldn't that be totally cool? :-)
> 
> Sounds interesting...
> 
> Although, with cvs, something like
> 
> last-modified(out.html) = max(last-checked-in(in.xml),last-checked-in(in.xsl))
> 
> might(?) be more appropriate...

Yes, you are right.
 
> (would it be possible to use the CVS generator to "create" in.xsl???)

Probably so, if we implement a CVS protocol handler...

> While we are on the topic of generators, I am just interested,
> will the following be possible? (sorry about my ASCII art...)
> 
> (/dir/to/images --> ImageDirectoryGenerator) --|
>                                                |
> (/otherdir/file.xml --> FileGenerator)  --> XalanTransformer --> output
> 
> ie, when transforming an input xml file, would it be possible to
> obtain image heights and widths from the ImageDirectoryGenerator, and
> insert them in the HTML tags <img href="..." height="..." width="...>,
> so that these don't have to be hard-coded?

 
> Or, perhaps, this is the wrong solution, and a better solution might
> be to get the HTML serializer to automatically add this information?
> --
> Brian May <ba...@snoopy.apana.org.au>

Either XSLT extentions or a special HTML serializer (maybe the default
HTML serializer could be patched to do that automatically).

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------



Re: Is Cocoon2 caching implemented?

Posted by Brian May <ba...@snoopy.apana.org.au>.
>>>>> "Stefano" == Stefano Mazzocchi <st...@apache.org> writes:

    >> Personally, my major concern for Cocoon 1 (and so far Cocoon
    >> 2), is that static web pages do not have the http
    >> "Last-Modified" header.

    Stefano> This is a matter or writing a new serialier (or improving
    Stefano> on existing ones) that is able to do this... there is
    Stefano> nothing in the C2 architecture that doesn't allow you to
    Stefano> do that.

I think the hardest part might be knowing

1. what "last modified" header to use.

2. Also when to use the "expires" header (dynamic pages should expire)
might be an issue.

I am guessing that 2 could be specified in the sitemap, however 1,
might be harder. You could have the last-modified date of the XML
file:

last-modified(out.html) = last-modified(in.xml)

or the XSL file:

last-modified(out.html) = last-modified(in.xsl)

Or perhaps something like:

last-modified(out.html) = max(last-modified(in.xml),last-modified(in.xsl))

would be more appropriate? I am assuming it is easy enough to obtain
the last-modified(in.xml) and last-modified(in.xsl) in the serializer
layer?

    Stefano> ... anyway, using a CVS generator and a proxy friendly
    Stefano> serializer could allow us to update the site directly
    Stefano> without having to touch anything, just trusting CVS
    Stefano> security and all documentation would be reflected
    Stefano> directly to the proxy (if modified from internal Cocoon
    Stefano> cache).

    Stefano> Wouldn't that be totally cool? :-)

Sounds interesting...

Although, with cvs, something like

last-modified(out.html) = max(last-checked-in(in.xml),last-checked-in(in.xsl))

might(?) be more appropriate...

(would it be possible to use the CVS generator to "create" in.xsl???)


While we are on the topic of generators, I am just interested,
will the following be possible? (sorry about my ASCII art...)

(/dir/to/images --> ImageDirectoryGenerator) --|
                                               |
(/otherdir/file.xml --> FileGenerator)  --> XalanTransformer --> output

ie, when transforming an input xml file, would it be possible to
obtain image heights and widths from the ImageDirectoryGenerator, and
insert them in the HTML tags <img href="..." height="..." width="...>,
so that these don't have to be hard-coded?

Or, perhaps, this is the wrong solution, and a better solution might
be to get the HTML serializer to automatically add this information?
-- 
Brian May <ba...@snoopy.apana.org.au>

Re: [Cocoon Devel]Is Cocoon2 caching implemented?

Posted by Stefano Mazzocchi <st...@apache.org>.
Brian May wrote:
> 
> >>>>> "Berin" == Berin Loritsch <bl...@infoplanning.com> writes:
> 
>     Berin> Jon Lancelle wrote:
>     >> Do you think such an implementation will eventually be a part
>     >> of Cocoon 2?
> 
>     Berin> I'm positive, it is a matter of time.
> 
>     Berin> For non-dynamic pages we have more than 100-fold
>     Berin> performance increase for the reward--definitely worth it.
> 
> What is the plan for static files? According to the documentation, I
> have read "To be able to put most of the static part job back on the
> web server (where it belongs), Cocoon2 will greatly improve it's
> command line operation, allowing the creation of site makefiles that
> will automatically scan the web site and the source documents and will
> provide a way to regenerate the static part of a web site (images and
> tables included!) based on the same XML model used in the dynamic
> operation version."
> 
> However, wouldn't this make caching redundant?

No.

I spent a lot of time thinking about this and I think that using proxies
up front is the way to go for very-low-update-frequency content (there
is no such thing as "static web content").

Cocoon2 in batch mode should be used to generate HTML documentation or
PDF manuals or a collection of SVG printouts... something that you place
in a non-serving enviornment (mostly a file system).

> Personally, my major concern for Cocoon 1 (and so far Cocoon 2), is
> that static web pages do not have the http "Last-Modified"
> header.

This is a matter or writing a new serialier (or improving on existing
ones) that is able to do this... there is nothing in the C2 architecture
that doesn't allow you to do that.

> This means that proxy http caches like squid will not cache
> the page, meaning it has to be re-down-loaded every time you access
> it, even if you only accessed it five minutes ago...

Correct, this is the way it should be done and I'm playing with the idea
of creating a mod_cocoon module for Apache 2.0 that might allow us to
use Apache mod_proxy directly for this, or filter the result of mod_perl
or mod_php directly. (yes, we can call PHP from inside C2 already, but
this is different and much more useful since allow people not to know
java nor PHP at all, just "chaining" services together).

But this is wild and won't happen before I can talk with the core Apache
2.0 people at ApacheCon2000 this fall.

Anyway, you are totally right, Cocoon should be more proxy-friendly
right from the core.
 
> I hope that one day, Cocoon2 will be able to create static HTML files
> (where practical), so that the web-server is responsible for
> generating these headers again.

 
> Then again, I have encountered this problem even for
> http://xml.apache.org/. It was my impression that this web site used
> static HTML pages???

Yes, xml.apache.org is batch generated and this sucks big time since we
can't make stylebook run on xml.apache.org since no good Java 1.2 JVM is
(yet) available for FreeBSD....

... anyway, using a CVS generator and a proxy friendly serializer could
allow us to update the site directly without having to touch anything,
just trusting CVS security and all documentation would be reflected
directly to the proxy (if modified from internal Cocoon cache).

Wouldn't that be totally cool? :-)

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------



Re: [Cocoon Devel]Is Cocoon2 caching implemented?

Posted by Brian May <ba...@snoopy.apana.org.au>.
>>>>> "Berin" == Berin Loritsch <bl...@infoplanning.com> writes:

    Berin> Jon Lancelle wrote:
    >> Do you think such an implementation will eventually be a part
    >> of Cocoon 2?

    Berin> I'm positive, it is a matter of time.

    Berin> For non-dynamic pages we have more than 100-fold
    Berin> performance increase for the reward--definitely worth it.

What is the plan for static files? According to the documentation, I
have read "To be able to put most of the static part job back on the
web server (where it belongs), Cocoon2 will greatly improve it's
command line operation, allowing the creation of site makefiles that
will automatically scan the web site and the source documents and will
provide a way to regenerate the static part of a web site (images and
tables included!) based on the same XML model used in the dynamic
operation version."

However, wouldn't this make caching redundant?

Personally, my major concern for Cocoon 1 (and so far Cocoon 2), is
that static web pages do not have the http "Last-Modified"
header. This means that proxy http caches like squid will not cache
the page, meaning it has to be re-down-loaded every time you access
it, even if you only accessed it five minutes ago...

I hope that one day, Cocoon2 will be able to create static HTML files
(where practical), so that the web-server is responsible for
generating these headers again.

Then again, I have encountered this problem even for
http://xml.apache.org/. It was my impression that this web site used
static HTML pages???
-- 
Brian May <ba...@snoopy.apana.org.au>

Re: Is Cocoon2 caching implemented?

Posted by Berin Loritsch <bl...@infoplanning.com>.
Jon Lancelle wrote:
> 
> Do you think such an implementation will eventually be a part of Cocoon 2?

I'm positive, it is a matter of time.

For non-dynamic pages we have more than 100-fold performance increase for
the reward--definitely worth it.

Re: Is Cocoon2 caching implemented?

Posted by Stefano Mazzocchi <st...@apache.org>.
Jon Lancelle wrote:
> 
> Do you think such an implementation will eventually be a part of Cocoon 2?

You can bet your ass on that :)

I mean: a Cocoon without a good cache is purely accademic, much like a
JVM without a good JIT compiler. To do real stuff you need both
useability and performance (also in the sense of scaleability).

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------



Re: Is Cocoon2 caching implemented?

Posted by Jon Lancelle <jk...@knosys.com>.
Do you think such an implementation will eventually be a part of Cocoon 2?

Jon


Ross Burton wrote:

> > My understanding is the transformation results created using Cocoon 1 are
> stored on the
> > server until a change to the XML file or stylesheet is made. Then a new
> result document is
> > created, and stored again on the server to be dished out until the next
> change occurs.
>
> They are - but this is Cocoon 2!  :-)
>
> Ross

Re: Is Cocoon2 caching implemented?

Posted by Ross Burton <ro...@mail.com>.

> My understanding is the transformation results created using Cocoon 1 are
stored on the
> server until a change to the XML file or stylesheet is made. Then a new
result document is
> created, and stored again on the server to be dished out until the next
change occurs.

They are - but this is Cocoon 2!  :-)

Ross


Re: Is Cocoon2 caching implemented?

Posted by Jon Lancelle <jk...@knosys.com>.
My understanding is the transformation results created using Cocoon 1 are stored on the
server until a change to the XML file or stylesheet is made. Then a new result document is
created, and stored again on the server to be dished out until the next change occurs.

Jon Lancelle


Giacomo Pati wrote:

> On Mon, Jul 31, 2000 at 05:24:53PM -0400, Berin Loritsch wrote:
> > I was evaluating performance, and if the pages are being generated
> > every time, the numbers I get are kosher.
> >
> > Basically, my pages are being generated between 100ms and 390ms
> > depending on load.  Considering I am running an Athlon 700 and
> > IBM's JDK 1.3, these are respectable times for the initial page
> > creation.
> >
> > If caching is implemented/enabled, then these times are way
> > too much.  In Cocoon1, Tomcat/Cocoon returns them from cache in
> > less than 1ms on my machine.
>
> Cache? What's a cache? :))
>
> Seriously, there is no cache implemented. every page undergoes the same generation steps.
>
> Giacomo
>
> --
> PWR GmbH, Organisation & Entwicklung      Tel:   +41 (0)1 856 2202
> Giacomo Pati, CTO/CEO                     Fax:   +41 (0)1 856 2201
> Hintereichenstrasse 7                     Mailto:Giacomo.Pati@pwr.ch
> CH-8166 Niederweningen                    Web:   http://www.pwr.ch