cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Upayavira">
Subject Re: if-modified-since and the CLI
Date Wed, 21 May 2003 09:43:08 GMT

Thanks for your reply.

> Sorry for the lag, I go to college during the week.  I don't check
> email as often as I should on weekdays.

Phew - you must have your work cut out with this list if you only read it at weekends!!
> Unfortunately, I don't know the CLI code very well (at all).  I was
> under the impression that the CLI creates a static set of pages
> according to the Cocoon sitemap declarations and a form of spidering. 

The CLI uses the Cocoon object to generate pages, in much the same way as the 
CocoonServlet does. In one situation, the request comes from an HTTP request, the 
other from a request on the command line. But what happens once the Cocoon 
object has received should be pretty much the same between the two (except that the 
CLI provides a CLI Environment, rather than a HTTPEnvironment).

> I'm gathering that I am mistaken.  Why would the CLI ever invoke the
> same URI pipeline twice -- and therefore make response modifications
> an issue?

The CLI probably won't invoke the same URI twice in one session, it is more across 
sessions that I'm concerned with. For example, imagine a site that contains 1000 
pages. You run the Cocoon CLI to generate it. You now have 1000 files on your hard 
drive. Then you change a single page and rerun the CLI. Do you want to have to 
regenerate all of those 1000 files, or just the one that has changed? Your if-modified-
since changes should make this quite easy to implement, if I understand them 

> >I've implemented the isResponseModified() and
> >setResponseIsNotModifed() methods in the
> >AbstractCommandLineEnvironment, but for some reason, they are never
> >called.
> >
> Unless there is a cached entry or the resource is a static file
> through a reader, these methods will not be called in any environment
> -- they're not in the code path in the uncached case.

The CLI uses the Cocoon object, which uses caching in the same way, regardless of 
whether called via the CLI or an HTTP request.

> >I presume they should be called automatically whenever a page is
> >generated. Can anyone explain why they're not called, and what I need
> >to do to get them called?
> >
> Can you be more specific about what you have in mind?  Getting 304s is
> an implementation of a goal, not the goal itself.  What do you hope do
> gain with the CLI and response modification info?

For me the aim is to prevent having to re-generate a page if it has not changed. This 
can vastly improve the efficiency and usefulness of the CLI if I can get this 

Hope that clarifies things.

Regards, Upayavira

View raw message