cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Gritsenko <>
Subject Re: CLI caching, etc (was Re: New error handling)
Date Wed, 16 Apr 2003 20:18:32 GMT
Upayavira wrote:

>>>>1. Implement setStatus() in AbstractCommandLineEnvironment 
>>>>(implementation is empty right now)
>>>>2. Add getStatus() to the AbstractCommandLineEnvironment
>>>>3. Test getStatus() in the CLI crawling code.
>>>>4. Test how it works and fix the broken link :)
>Works a treat! Thanks. Although I had to modify the sitemap to give error codes 
>(thanks Jeremy for your recent mail!)


>>Before you go further with this... Look at method isResponseModified()
>>in [1].
>>What you need to do is to:
>>1. Implement method isResponseModified() for command line environment.
>>2. In the CLI, get the file corresponding to the request URI, and get
>>its last modification time. 3. Populate environment with this
>>modification time (this will be similar to If-Modified-Since date
>>header in http). 4. Call cocoon. It will skip generation if response
>>is not modified, and won't even read it from cache.
>Very interesting. So Cocoon can tell me if something has been modified. Great. 

Yes, and it works in http env.

>However, if the Bean is able to send pages to various locations, it might not be able
>identify when a page was generated without network traffic (e.g when using FTP).

In case of ftp you can retrieve timestamp of the file from remote ftp 
server (which is tricky). You can do "ls -l" and get timestamps for the 
all files in the directory, and save them in the hash.

>This would be unfortunate, as a large site could involve a lot of network traffic, and

>the point of this is to avoid that.
>I could store locally (in my own hashed up cache) the last modified date for the page

>and the list of links within the page, each time a page is generated. That way, when I

>am about to generate a page, I can easily get its timestamp. If I find that I don't need

>to generate the page, I can use my locally held list of links to follow.
>Does this seem reasonable?

It does not seems unreasonable, so it should be reasonable :)

>And finally, I have got code working to make the CLI use ModifiableSources rather 
>than Destination objects. 


>Do you think I need to support the Destination interface still 
>(and deprecate it), or can I just delete it entirely?

No; delete it entirely before it was ever released. No need to support 
never-released stuff.

>Once I've got this going, I'll get on with attempting a VFS ModifiableSource (probably

>once I've had a three week holiday in South Africa!).

3 week... Lucky you.


>Thanks again.
>Regards, Upayavira

View raw message