disable nginx cache when skyd cache is enabled
This commit is contained in:
parent
ed20ed5e24
commit
b827616fab
|
@ -29,7 +29,6 @@ services:
|
||||||
- SKYD_DISK_CACHE_SIZE=${SKYD_DISK_CACHE_SIZE:-53690000000} # 50GB
|
- SKYD_DISK_CACHE_SIZE=${SKYD_DISK_CACHE_SIZE:-53690000000} # 50GB
|
||||||
- SKYD_DISK_CACHE_MIN_HITS=${SKYD_DISK_CACHE_MIN_HITS:-3}
|
- SKYD_DISK_CACHE_MIN_HITS=${SKYD_DISK_CACHE_MIN_HITS:-3}
|
||||||
- SKYD_DISK_CACHE_HIT_PERIOD=${SKYD_DISK_CACHE_HIT_PERIOD:-3600} # 1h
|
- SKYD_DISK_CACHE_HIT_PERIOD=${SKYD_DISK_CACHE_HIT_PERIOD:-3600} # 1h
|
||||||
|
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
volumes:
|
volumes:
|
||||||
|
@ -65,6 +64,8 @@ services:
|
||||||
logging: *default-logging
|
logging: *default-logging
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
|
environment:
|
||||||
|
- SKYD_DISK_CACHE_ENABLED=${SKYD_DISK_CACHE_ENABLED:-false}
|
||||||
volumes:
|
volumes:
|
||||||
- ./docker/data/nginx/cache:/data/nginx/cache
|
- ./docker/data/nginx/cache:/data/nginx/cache
|
||||||
- ./docker/data/nginx/blocker:/data/nginx/blocker
|
- ./docker/data/nginx/blocker:/data/nginx/blocker
|
||||||
|
|
|
@ -11,4 +11,11 @@ proxy_cache_bypass $cookie_nocache $arg_nocache;
|
||||||
# no cache - this will ignore cache on request (status MISS)
|
# no cache - this will ignore cache on request (status MISS)
|
||||||
# and does not store file in cache under no condition
|
# and does not store file in cache under no condition
|
||||||
set_if_empty $nocache "0";
|
set_if_empty $nocache "0";
|
||||||
proxy_no_cache $nocache;
|
|
||||||
|
# map skyd env variable value to "1" for true and "0" for false (expected by proxy_no_cache)
|
||||||
|
set_by_lua_block $skyd_disk_cache_enabled {
|
||||||
|
return os.getenv("SKYD_DISK_CACHE_ENABLED") == "true" and "1" or "0"
|
||||||
|
}
|
||||||
|
|
||||||
|
# disable cache when nocache is set or skyd cache is enabled
|
||||||
|
proxy_no_cache $nocache $skyd_disk_cache_enabled;
|
||||||
|
|
|
@ -31,6 +31,7 @@ env SKYNET_SERVER_API;
|
||||||
env PORTAL_MODULES;
|
env PORTAL_MODULES;
|
||||||
env ACCOUNTS_LIMIT_ACCESS;
|
env ACCOUNTS_LIMIT_ACCESS;
|
||||||
env SIA_API_PASSWORD;
|
env SIA_API_PASSWORD;
|
||||||
|
env SKYD_DISK_CACHE_ENABLED;
|
||||||
|
|
||||||
events {
|
events {
|
||||||
worker_connections 8192;
|
worker_connections 8192;
|
||||||
|
|
Reference in New Issue