Control Web Panel

WebPanel => Apache => Varnish => Topic started by: Farukh Khan on November 05, 2015, 01:58:47 PM

Title: How to exclude any file or folder from varnish cache?
Post by: Farukh Khan on November 05, 2015, 01:58:47 PM
Hello,

I have hosted a File Server in my web hosting running with CWP. I have got huge files there like 6 GB 10 GB also small files like 6 MB 10 MB 150 MB. Now I want my CWP varnish cache not to cache these files because these files got direct download links and might get updated very often. How can I do that? I have facing a problem with the greater files like 6 GB or 10 GB files. When I use varnish cache in my server I cannot get direct download of these files. The direct download literally doesn't work. If I disable varnish and only keep apache then all the downloads work. What might be the solution to this problem?


Please help CWP team.


Thanks in advance...
Title: Re: How to exclude any file or folder from varnish cache?
Post by: Igor S. on November 10, 2015, 07:05:59 AM
Hello.

You can configure it manualy.
Just add in vcl_recv something like that:

Code: [Select]
if (req.url ~ "^/path/to/exclude/folder") {
return(pass);
}
Title: Re: How to exclude any file or folder from varnish cache?
Post by: Farukh Khan on November 11, 2015, 09:52:49 PM
Not working for me...
Title: Re: How to exclude any file or folder from varnish cache?
Post by: Farukh Khan on November 13, 2015, 05:21:30 PM
Any good way to do it from admins? Because the suggestion of Igor seems not working at all...
Title: Re: How to exclude any file or folder from varnish cache?
Post by: Farukh Khan on November 14, 2015, 01:47:57 PM
No admin to help?
Title: Re: How to exclude any file or folder from varnish cache?
Post by: Igor S. on November 20, 2015, 08:17:57 AM
No admin to help?

Let us know if you will found a solution.