increase min uses and cache size (#1060)
* increase min uses and cache size * lower the time from 14 days to 2 days
This commit is contained in:
parent
a7db096fe9
commit
b00d93cfa6
|
@ -1,4 +1,4 @@
|
||||||
proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=skynet:10m max_size=10g inactive=24h use_temp_path=off;
|
proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=skynet:10m max_size=50g inactive=48h use_temp_path=off;
|
||||||
|
|
||||||
# this runs before forking out nginx worker processes
|
# this runs before forking out nginx worker processes
|
||||||
init_by_lua_block {
|
init_by_lua_block {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
set $nocache 0; # internal variable for bypassing the cache, nginx expects 0/1 for boolean
|
set $nocache 0; # internal variable for bypassing the cache, nginx expects 0/1 for boolean
|
||||||
proxy_cache skynet; # cache name
|
proxy_cache skynet; # cache name
|
||||||
proxy_cache_key $skylink_v1$path$arg_format$arg_attachment$arg_start$arg_end$http_range; # unique cache key
|
proxy_cache_key $skylink_v1$path$arg_format$arg_attachment$arg_start$arg_end$http_range; # unique cache key
|
||||||
proxy_cache_valid 200 206 24h; # cache 200 and 206 responses for 24 hours
|
proxy_cache_min_uses 3; # cache after 3 uses
|
||||||
|
proxy_cache_valid 200 206 307 48h; # keep 200, 206 and 307 responses valid for up to 2 days
|
||||||
proxy_cache_bypass $nocache $cookie_nocache $arg_nocache; # add cache bypass option
|
proxy_cache_bypass $nocache $cookie_nocache $arg_nocache; # add cache bypass option
|
||||||
add_header X-Proxy-Cache $upstream_cache_status; # add response header to indicate cache hits and misses
|
add_header X-Proxy-Cache $upstream_cache_status; # add response header to indicate cache hits and misses
|
||||||
|
|
Reference in New Issue