From bba571c4e350fd35cfc40b435ccc93f3ba0c6764 Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Thu, 23 Apr 2020 20:02:02 +0200 Subject: [PATCH] add frequent downloads cache to improve server responding on popular files --- setup-scripts/skynet-nginx.conf | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/setup-scripts/skynet-nginx.conf b/setup-scripts/skynet-nginx.conf index bf4b9bc3..8031ebd2 100644 --- a/setup-scripts/skynet-nginx.conf +++ b/setup-scripts/skynet-nginx.conf @@ -100,6 +100,12 @@ server { # if you are expecting large headers (ie. Skynet-Skyfile-Metadata), tune these values to your needs #proxy_buffer_size 128k; #proxy_buffers 4 128k; + + # cache frequent (> 10) downloads for 24 hours + proxy_cache skynet; + proxy_cache_key $uri; + proxy_cache_min_uses 10; + proxy_cache_valid 200 1440m; } location ~ "^/file/([a-zA-Z0-9-_]{46}(/.*)?)$" { @@ -120,6 +126,12 @@ server { # if you are expecting large headers (ie. Skynet-Skyfile-Metadata), tune these values to your needs #proxy_buffer_size 128k; #proxy_buffers 4 128k; + + # cache frequent (> 10) downloads for 24 hours + proxy_cache skynet; + proxy_cache_key $uri; + proxy_cache_min_uses 10; + proxy_cache_valid 200 1440m; } # SLL CERTIFICATES BELOW THIS LINE