Re: [squid-users] Chunked and Range header support

From: Chris Bennett <chris_at_ceegeebee.com>
Date: Thu, 4 Jul 2013 20:59:55 +0930

Hi Anita,

> 2) Range headers - from my understanding, it looks like they use this for
> video streaming.. it looks like the client can request a part of the object
> body to be sent alone to him. Is it correct? In this case, if multiple
> ranges are requested, is it sent separately or in a consolidated manner?

I'm not sure what your use case is, but I've been playing with youtube
caching lately, and range headers play a part in trying to cache
client requests.

Squid won't cache range header requests for specific byte ranges.
However, squid can accept range headers from client and discard them
when sending upstream.

  range_offset_limit -1 [<optional_acl>]

will do the job. I use an ACL to only apply it to specific domains I
want the behaviour for.

Squid will serve the client the correct bytes, but by discarding the
range headers for the upstream retrieval, it will cache the whole
object and subsequent range requests for the cached object will result
in a hit.

Parallel simultaneous requests to the same object with a range header
will likely result in parallel, full retrieval of the whole file
though (I say likely as I havn't tested but suspect that will be the
case).

A related behaviour on youtube specifically (and possibly others) is
the use of '&range=X-Y' URL parameters instead of range header
requests. I've noticed this more on web-browsers on PCs, whereas I've
seen the range header requests on Apple IOS mobile platforms.

There have been some clever tricks using storeurlrewrite or storeid to
include the range bytes in the key of the object stored, so without
the use of range_offset_limit, squid can store an object per unique
client range request & provide a hit for subsequent requests. My
testing has indicated this is unreliable as the byte-ranges tend to be
dynamic based on the clients current bitrates so off-by-one range
requests result in a lot of duplication in the cache.

You can also utilise an ICAP server to do even funkier stuff like
mould range URL parameters into range header requests so the different
client behaviours share the same cache objects.

Eliezer Croitoru (on this list) is the expert and has been a huge help
in getting me to where my understanding is.

I don't know if this is way too much information for what you are
looking at, but it's fresh in my memory so I thought I'd dump it all
out and you can pick out anything of use :)

Regards,

Chris
Received on Thu Jul 04 2013 - 11:30:11 MDT

This archive was generated by hypermail 2.2.0 : Fri Jul 05 2013 - 12:00:11 MDT