cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ard Schrijvers" <a.schrijv...@hippo.nl>
Subject RE: Cached AbstractReader
Date Thu, 20 Dec 2007 13:25:31 GMT
>From the top of my head (so might be off a little)

You should be able to wrap the src in your reader with the cached:
protocol source-factory (just start with src="cached:..." ), and make it
a asynchronous (when the remote image isn't available which is refetched
in the background, the formerly fetched image will be served) get
possibly with an expires (see cocoon.xconf, there are examples).
Obviously, extending the mechanism to serve a default image when the
remote source isn't available is trivial

Regards Ard

> 
> 
> Jon Evans wrote:
> > I've implemented a class which extends AbstractReader. It uses some 
> > SOAP calls to pull some binary gif image data from a remote system.
> > My problem is that the resource is not cached if I throw a 
> > MissingResourceException.
> > At the moment, products with no icons cause the remote system to be 
> > hit every time, and the SOAP calls are quite slow.
> >
> > The only thing I can think of is to stream the default 
> image data out 
> > of my reader if the product has no image, by directly opening the 
> > default image file from disk inside the reader.
> 
> Yes, I think this is the best course of action.
> 
> You might want to make the path to the default image a 
> configuration parameter, of course, so that you won't have to 
> recompile your reader when the path changes, or if you want 
> different default images for different products.
> 
> 
> Tobia
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message