mirror of
https://github.com/lancachenet/monolithic
synced 2024-11-21 19:43:05 +00:00
Use conditional slicing
This commit is contained in:
parent
d01c26ae0d
commit
1bbb96230c
3 changed files with 7 additions and 2 deletions
4
overlay/etc/nginx/conf.d/31_slice_maps.conf
Normal file
4
overlay/etc/nginx/conf.d/31_slice_maps.conf
Normal file
|
@ -0,0 +1,4 @@
|
|||
map "${cacheidentifier}${http_range}" $slice_range_actual {
|
||||
default $slice_range; # Use the calculated slice range by default
|
||||
~steam$ ""; # Disable slicing for Steam when the client request isn't a range, as not all CDN nodes accept range requests
|
||||
}
|
|
@ -4,7 +4,8 @@
|
|||
|
||||
proxy_ignore_headers Expires Cache-Control;
|
||||
proxy_cache_valid 200 206 CACHE_MAX_AGE;
|
||||
proxy_set_header Range $slice_range;
|
||||
# $slice_range_actual is set from the map in 31_slice_maps.conf
|
||||
proxy_set_header Range $slice_range_actual;
|
||||
|
||||
# Only download one copy at a time and use a large timeout so
|
||||
# this really happens, otherwise we end up wasting bandwith
|
||||
|
|
|
@ -1 +1 @@
|
|||
proxy_cache_key $cacheidentifier$uri$slice_range;
|
||||
proxy_cache_key $cacheidentifier$uri$slice_range_actual;
|
||||
|
|
Loading…
Reference in a new issue