Return-Path: Delivered-To: apmail-xml-cocoon-dev-archive@xml.apache.org Received: (qmail 37499 invoked by uid 500); 31 May 2002 14:59:45 -0000 Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-dev@xml.apache.org Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 37480 invoked from network); 31 May 2002 14:59:45 -0000 From: "Vadim Gritsenko" To: Subject: RE: How to implement byte range support? Date: Fri, 31 May 2002 10:58:40 -0400 Message-ID: <002901c208b3$a679e610$7574558b@vgritsenkopc> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2616 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 In-Reply-To: <96819846-74A4-11D6-8385-0030654777A6@adolos.co.uk> Importance: Normal X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N > 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, > > 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 --------------------------------------------------------------------- To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org For additional commands, email: cocoon-dev-help@xml.apache.org