Re: Can byterange filter request only needed ranges from my module instead of discarding?

2017-02-26 Thread Nick Kew
On Sun, 2017-02-26 at 21:00 +0300, Basin Ilya wrote:
> Instead of writing data in my handler can I create there a custom bucket, let 
> the byterange filter split it properly and let the core filter call my custom 
> read function?

I think so in principle.  Your bucket type would have to
satisfy byterange_filter, meaning it has to know its own length.

In practice, it may not work as you expect.  If there's any
content filter between your handler and the byterange module,
then that will read your bucket and defeat your purpose.

Why not write a mock-up of your proposed design?  Say, a
bucket that serves data from a static file by seek/read,
just to see how it behaves in different configurations
and whether you can make the architecture work for you?

-- 
Nick Kew



Re: Can byterange filter request only needed ranges from my module instead of discarding?

2017-02-26 Thread Basin Ilya
Instead of writing data in my handler can I create there a custom bucket, let 
the byterange filter split it properly and let the core filter call my custom 
read function?

On 26.02.2017 15:23, Nick Kew wrote:
> On Sun, 2017-02-26 at 15:02 +0300, Basin Ilya wrote:
> 
>> However, it's inefficient to serve huge virtual files this way when only a 
>> small part of such file requested. How to solve this?
> 
> Unless your module can handle the byterange itself, you might
> want to consider cacheing the generated file for the benefit
> of future byterange requests.
> 


Re: Can byterange filter request only needed ranges from my module instead of discarding?

2017-02-26 Thread Nick Kew
On Sun, 2017-02-26 at 15:02 +0300, Basin Ilya wrote:

> However, it's inefficient to serve huge virtual files this way when only a 
> small part of such file requested. How to solve this?

Unless your module can handle the byterange itself, you might
want to consider cacheing the generated file for the benefit
of future byterange requests.

-- 
Nick Kew



Can byterange filter request only needed ranges from my module instead of discarding?

2017-02-26 Thread Basin Ilya
Hi.
I have a custom module that generates its output on the fly. (Consider a 
hypothetical "download.cgi" or "download.php", but it's a module, not script).
I don't process the range headers myself. I just write the whole data using 
ap_rwrite(). If the client performs a ranged request, the byterange filter 
discards some of my output and sends a correct multipart response.

However, it's inefficient to serve huge virtual files this way when only a 
small part of such file requested. How to solve this?