> lfhc pisze:
> > Hi,
> > what I'm trying to do is to transform this :
> > 
> > <xml ...
> > 
> > <image>http://sourceurl/path/image.jpg</image>
> > 
> > to
> > 
> > http://cocoonurl/image.jpg  where this image is resized.


> 
> You need something like this:
> <map:match pattern="images/**"
>    <map:read type="image-op-scale" 
> src="cached:http://sourceurl/{1}?cocoon:cache-expires=60&cocoo
> n:cache-name=cached-images"/>
> </map:match>

Don't you think it would be much easier to use mod_cache between the browser 
and cocoon to handle the caching of binary files like these? Furthermore, 
making sure the reader gets a correct expires value in the component 
configuration makes the images properly cacheable by browsers too (if mod_cache 
honours the ttl headers of cocoon of course)

So, for example, in your components, declare:

<map:reader name="image" src="org.apache.cocoon.reading.ImageReader" 
logger="sitemap.reader.image" pool-max="32" pool-min="1" pool-grow="4">
      <parameter name="expires" value="86400000"/>
</map:reader>

And have a matcher

<map:match pattern="readImage/*/*/**" >
            <map:read src="{2}" type="image">
                <map:parameter name="width" value="{1}"/>
                <map:parameter name="height" value="{2}"/>
            </map:read>
</map:match>

This should do the trick. If you insist on caching it in cocoon as well, of 
course you can use the wrapped src suggestion of Grzegorz

Regards Ard


> 
> This way you will get proxy-like behaviour thanks to Cocoon's 
> cached: protocol thus avoiding re-downloading original images 
> again and again.
> 
> For description of cached source, take a look at: 
> http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/compone
> nts/source/impl/CachingSource.html
> 
> -- 
> Grzegorz Kossakowski
> http://reflectingonthevicissitudes.wordpress.com/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to