Mailing List Archive

Use varnish-cache in front of HLS servers for live streaming
Hi,
I want to use varnish as a cache server in front of my Http live streaming servers to serves .ts files to client and I want to ignore caching .m3u8 files extension to be cached.
When I read how varnish would cache the objects again, I encountered with some issues for example because each clients would request the .ts files from varnish directly or through load balancers (load balancer would pass all headers to varnish) so for unique .ts file , varnish will cache the file for each client! so I should normalize header or delete some clients header or somehow I should tell varnish that this file is unique and dont cache it again based on different useless header...
How can I tell this to varnish or which header should be deleted by varnish because I don't know which client would send which header !
which header would affect on double caching?
Is there any sample config to satisfy my needs?
Re: Use varnish-cache in front of HLS servers for live streaming [ In reply to ]
Hi,

By default, Varnish only hashes the host and URL (including the query
string):
https://github.com/varnishcache/varnish-cache/blob/master/bin/varnishd/builtin.vcl#L124

So you possibly need to clean the query string.

Or, while unlikely, it could be that your backend is returning a Vary
header, in which case, you should remove the request headers corresponding
to this (ignore content-encoding though)

--
Guillaume Quintard


On Thu, Jun 10, 2021 at 3:54 AM Hamidreza Hosseini <hrhosseini@hotmail.com>
wrote:

> Hi,
> I want to use varnish as a cache server in front of my Http live streaming
> servers to serves .ts files to client and I want to ignore caching .m3u8
> files extension to be cached.
> When I read how varnish would cache the objects again, I encountered with
> some issues for example because each clients would request the .ts files
> from varnish directly or through load balancers (load balancer would pass
> all headers to varnish) so for unique .ts file , varnish will cache the
> file for each client! so I should normalize header or delete some clients
> header or somehow I should tell varnish that this file is unique and dont
> cache it again based on different useless header...
> How can I tell this to varnish or which header should be deleted by
> varnish because I don't know which client would send which header !
> which header would affect on double caching?
> Is there any sample config to satisfy my needs?
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc@varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>