Re: URL caching in pipelines
Miles Elam wrote: I want to put a Slashdot feed on my web page with the following (out of context for brevity): pipeline map:match pattern=feeds/slashdot.org map:generate src=http://slashdot.org/slashdot.xml/ map:serialize type=xml/ /map:match /pipeline This works fine, but the server opens a socket to Slashdot on every request to my page. If my site gets some traffic, Slashdot will not be happy with me. Further, my bandwidth usage goes up. And when Slashdot (and others) become slow, my site will become slow right along with them. None is particularly appealing. From the Slashdot syndication page (slashcode): Do whatever you want, but *don't* access the file more than once every 30 minutes. I went hunting in the mail archives for user and dev and came up with the following: pipeline expires=now plus 30 minutes map:match pattern=feeds/slashdot.org map:generate src=http://slashdot.org/slashdot.xml/ map:serialize type=xml/ /map:match /pipeline No difference. My server's still hitting Slashdot over and over. I tried telnet-ing to the port to at least check for expires headers. No dice. I looked at HttpHeaderAction but that doesn't seem to touch Cocoon's cache at all (so of limited use to me). I've used both 2.0.3 and 2.1 CVS (as of two weeks ago). A part of me smiles when I think that if Slashdot ever slashdotted me, they would be somewhat slashdotted themselves, but this is not my intent and I very much want to be a decent feed client. Anyone have any ideas? ...preferably with little stress on my server. If you have not found solution yet... Extend FileGenerator and override generateKey() and generateValidity() methods. generateKey() may return something like HashUtil.hash(this.source), and generateValidity() can return new DeltaTimeCacheValidity(30) to cache response for 30 minutes. See cacheable.xsp for sample code. Vadim - Miles Elam - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
URL caching in pipelines
I want to put a Slashdot feed on my web page with the following (out of context for brevity): pipeline map:match pattern=feeds/slashdot.org map:generate src=http://slashdot.org/slashdot.xml/ map:serialize type=xml/ /map:match /pipeline This works fine, but the server opens a socket to Slashdot on every request to my page. If my site gets some traffic, Slashdot will not be happy with me. Further, my bandwidth usage goes up. And when Slashdot (and others) become slow, my site will become slow right along with them. None is particularly appealing. From the Slashdot syndication page (slashcode): Do whatever you want, but *don't* access the file more than once every 30 minutes. I went hunting in the mail archives for user and dev and came up with the following: pipeline expires=now plus 30 minutes map:match pattern=feeds/slashdot.org map:generate src=http://slashdot.org/slashdot.xml/ map:serialize type=xml/ /map:match /pipeline No difference. My server's still hitting Slashdot over and over. I tried telnet-ing to the port to at least check for expires headers. No dice. I looked at HttpHeaderAction but that doesn't seem to touch Cocoon's cache at all (so of limited use to me). I've used both 2.0.3 and 2.1 CVS (as of two weeks ago). A part of me smiles when I think that if Slashdot ever slashdotted me, they would be somewhat slashdotted themselves, but this is not my intent and I very much want to be a decent feed client. Anyone have any ideas? ...preferably with little stress on my server. - Miles Elam - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: URL caching in pipelines
Try the WebServicesProxyGenerator. It uses the HttpClient library, which might actually support caching. Have not tried it though. Ivelin - Original Message - From: Miles Elam [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, October 06, 2002 9:13 PM Subject: URL caching in pipelines I want to put a Slashdot feed on my web page with the following (out of context for brevity): pipeline map:match pattern=feeds/slashdot.org map:generate src=http://slashdot.org/slashdot.xml/ map:serialize type=xml/ /map:match /pipeline This works fine, but the server opens a socket to Slashdot on every request to my page. If my site gets some traffic, Slashdot will not be happy with me. Further, my bandwidth usage goes up. And when Slashdot (and others) become slow, my site will become slow right along with them. None is particularly appealing. From the Slashdot syndication page (slashcode): Do whatever you want, but *don't* access the file more than once every 30 minutes. I went hunting in the mail archives for user and dev and came up with the following: pipeline expires=now plus 30 minutes map:match pattern=feeds/slashdot.org map:generate src=http://slashdot.org/slashdot.xml/ map:serialize type=xml/ /map:match /pipeline No difference. My server's still hitting Slashdot over and over. I tried telnet-ing to the port to at least check for expires headers. No dice. I looked at HttpHeaderAction but that doesn't seem to touch Cocoon's cache at all (so of limited use to me). I've used both 2.0.3 and 2.1 CVS (as of two weeks ago). A part of me smiles when I think that if Slashdot ever slashdotted me, they would be somewhat slashdotted themselves, but this is not my intent and I very much want to be a decent feed client. Anyone have any ideas? ...preferably with little stress on my server. - Miles Elam - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: URL caching in pipelines
Ivelin Ivanov wrote: Try the WebServicesProxyGenerator. It uses the HttpClient library, which might actually support caching. Have not tried it though. Ivelin Thanks, but a quick browse through the source doesn't reveal anything about forced caching. To be more specific, the HttpClient would support caching of content that is flagged as cacheable by the server, but if they server doesn't send an expires header, HttpClient (to my knowledge) would make just as many requests but with an If-Modified-Since header. Since the feed on the server is a static file that periodically generated, HttpClient may save bandwidth, but do basically nothing for server load. Somehow I think the latter is of more interest to the Slashdot folks since the file is about 6K. What I'm looking for is a way to mandate to my Cocoon installation that I don't care more often than every thirty minutes. As a bonus, I'd like it to allow the cache to agree so that my stylesheets aren't reprocessed unnecessarily. I know. I'm asking a lot. ;-) Wasn't Gianugo Rabellino working on something like this? - Miles Elam - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]