cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stuart Roebuck <stuart.roeb...@adolos.co.uk>
Subject Re: How to implement byte range support?
Date Fri, 31 May 2002 15:27:07 GMT
On Friday, May 31, 2002, at 03:58 PM, Vadim Gritsenko wrote:

>> From: Stuart Roebuck [mailto:stuart.roebuck@adolos.co.uk]
>>
>> I really need to get byte range support working in Cocoon 2 with the
>> ResourceReader as it appears  that some audio players just will not
>> accept MP3 files if the server does not provide byte-range support
> (e.g.
>> Windows Media Player) even after I patched Cocoon 2.0.2 to no longer
>> advertise byte-range support (e.g. change the Accept-Ranges:bytes
> header
>> to Accept-Ranges:none). I have a site which is using Cocoon based
> access
>> control mechanisms to deliver the files so I can't easily serve the
>> files from a non-Cocoon based server.
>>
>> I would appreciate some advice on how best to tackle this...
>>
>> I presume that I could try adding support directly into
> ResourceReader,
>> but I would have to disable the CachingStreamPipeline or add the range
>> data into the cache key - otherwise a partial output would be cached
>> rather than the whole file.  However, adding the range to the cache
> key
>> might significantly reduce the hit rate and rapidly fill the cache.
>>
>> The more favorable approach, assuming that I'm on the write track,
> would
>> be to add support to the Pipeline so that the generator (the
>> ResourceReader in this case) would act as normal, and the
>> CachingOutputStream would cache the entire Resource, but the
>> CachingStreamPipeline and StreamPipeline would both be altered to
> return
>> only the request byte ranges.
>>
>> Do any of these suggestions seem sensible or is this more complex than
>> I'm imagining?
>>
>> (I would prefer to change 2.0.2 rather than move the live site to a
> more
>> recent non-release version.)
>
> If you want to stay with 2.0.x, which is totally understandable... I
> would suggest to create ByterangeResourceReader which will advertise and
> implement byte range support, and will return 0 in getLastModified() to
> disable caching.
>
> Vadim

Thanks for the quick response - ByterangeResourceReader is underway!

Stuart.


            Public Key - 1024D/88DD65AF 2001-11-23 Stuart Roebuck (Adolos)
      Key fingerprint = 89D9 E405 F8B1 9B22 0FA2  F2C1 9E57 5AB1 88DD 65AF
-------------------------------------------------------------------------
Stuart Roebuck                                  stuart.roebuck@adolos.com
Systems Architect                             Java, XML, MacOS X, XP, 
etc.
ADOLOS                                           <http://www.adolos.com/>


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


Mime
View raw message