Search code examples
cachingrangevarnishvarnish-vcl

How can I configure Varnish to cache range requests?


I'm trying to configure Varnish to cache range requests. I notice the http_range_support option, but everything I've read says that this will attempt to cache the entire file before satisfying the request. Is it possible to do so without requiring the entire file already be cached?


Solution

  • Depends on Varnish version,

    From Varnish 3.0.2 you can stream uncached content while it caches the full object.

    https://www.varnish-software.com/blog/http-streaming-varnish

    "Basically, his code lifts the limitations of the 3.0 release and allows Varnish to deliver the objects, while they are being fetched, to multiple clients."

    The feature will be available on beresp.do_stream

    https://www.varnish-software.com/blog/streaming-varnish-30