From 51753881f9b7bbe31b37e068c978b7e82498c096 Mon Sep 17 00:00:00 2001 From: VibroAxe Date: Sat, 9 Oct 2021 11:07:12 +0000 Subject: [PATCH] Switch to using proxy_cache_lock_age This allows us to cache the response in the event a file hasn't been downloaded yet Set to 2m as a really long time to download a single 1m slice from upstream Based on thoughts from https://github.com/lancachenet/generic/pull/113 --- .../nginx/sites-available/cache.conf.d/root/20_cache.conf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/overlay/etc/nginx/sites-available/cache.conf.d/root/20_cache.conf b/overlay/etc/nginx/sites-available/cache.conf.d/root/20_cache.conf index 294a6a4..263b874 100644 --- a/overlay/etc/nginx/sites-available/cache.conf.d/root/20_cache.conf +++ b/overlay/etc/nginx/sites-available/cache.conf.d/root/20_cache.conf @@ -10,6 +10,10 @@ # this really happens, otherwise we end up wasting bandwith # getting the file multiple times. proxy_cache_lock on; + # If it's taken over a minute to download a 1m file, we are probably stuck! + # Allow the next request to cache + proxy_cache_lock_age 2m; + # If it's totally broken after an hour, stick it in bypass (this shouldn't ever trigger) proxy_cache_lock_timeout 1h; # Allow the use of state entries @@ -28,3 +32,4 @@ # 40G max file proxy_max_temp_file_size 40960m; +