Skip to content

feat: Adding PROXY_CACHE_USE_STALE env variable #438

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile.buildkit.plus
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ ENV PROXY_CACHE_SLICE_SIZE=1m
ENV PROXY_CACHE_VALID_OK=1h
ENV PROXY_CACHE_VALID_NOTFOUND=1m
ENV PROXY_CACHE_VALID_FORBIDDEN=30s
ENV PROXY_CACHE_USE_STALE='error timeout http_500 http_502 http_503 http_504'

# CORS env vars
ENV CORS_ENABLED=0
Expand Down
1 change: 1 addition & 0 deletions Dockerfile.oss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ENV PROXY_CACHE_SLICE_SIZE=1m
ENV PROXY_CACHE_VALID_OK=1h
ENV PROXY_CACHE_VALID_NOTFOUND=1m
ENV PROXY_CACHE_VALID_FORBIDDEN=30s
ENV PROXY_CACHE_USE_STALE='error timeout http_500 http_502 http_503 http_504'

# CORS env vars
ENV CORS_ENABLED=0
Expand Down
1 change: 1 addition & 0 deletions Dockerfile.plus
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ ENV PROXY_CACHE_SLICE_SIZE=1m
ENV PROXY_CACHE_VALID_OK=1h
ENV PROXY_CACHE_VALID_NOTFOUND=1m
ENV PROXY_CACHE_VALID_FORBIDDEN=30s
ENV PROXY_CACHE_USE_STALE='error timeout http_500 http_502 http_503 http_504'

# CORS env vars
ENV CORS_ENABLED=0
Expand Down
1 change: 1 addition & 0 deletions common/etc/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ env PROXY_CACHE_VALID_OK;
env PROXY_CACHE_SLICE_SIZE;
env PROXY_CACHE_VALID_NOTFOUND;
env PROXY_CACHE_VALID_FORBIDDEN;
env PROXY_CACHE_USE_STALE;
env HEADER_PREFIXES_TO_STRIP;
env FOUR_O_FOUR_ON_EMPTY_BUCKET;
env STRIP_LEADING_DIRECTORY_PATH;
Expand Down
2 changes: 1 addition & 1 deletion common/etc/nginx/templates/default.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ server {
proxy_cache_revalidate on;
proxy_cache_background_update on;
proxy_cache_lock on;
proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
proxy_cache_use_stale ${PROXY_CACHE_USE_STALE};
proxy_cache_key "$request_method$host$uri";

# If you need to support proxying range request, refer to this article:
Expand Down
1 change: 1 addition & 0 deletions deployments/s3_express/settings.s3express.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ PROXY_CACHE_INACTIVE=60m
PROXY_CACHE_VALID_OK=1h
PROXY_CACHE_VALID_NOTFOUND=1m
PROXY_CACHE_VALID_FORBIDDEN=30s
PROXY_CACHE_USE_STALE='error timeout http_500 http_502 http_503 http_504'
65 changes: 33 additions & 32 deletions docs/getting_started.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions settings.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ PROXY_CACHE_INACTIVE=60m
PROXY_CACHE_VALID_OK=1h
PROXY_CACHE_VALID_NOTFOUND=1m
PROXY_CACHE_VALID_FORBIDDEN=30s
PROXY_CACHE_USE_STALE='error timeout http_500 http_502 http_503 http_504'
STRIP_LEADING_DIRECTORY_PATH=/somepath
1 change: 1 addition & 0 deletions standalone_ubuntu_oss_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ echo "Slice of slice for byte range requests: ${PROXY_CACHE_SLICE_SIZE}"
echo "Proxy Caching Time for Valid Response: ${PROXY_CACHE_VALID_OK}"
echo "Proxy Caching Time for Not Found Response: ${PROXY_CACHE_VALID_NOTFOUND}"
echo "Proxy Caching Time for Forbidden Response: ${PROXY_CACHE_VALID_FORBIDDEN}"
echo "Proxy Cache Using Stale: ${PROXY_CACHE_USE_STALE:-'error timeout http_500 http_502 http_503 http_504'}"
echo "CORS Enabled: ${CORS_ENABLED}"
echo "CORS Allow Private Network Access: ${CORS_ALLOW_PRIVATE_NETWORK_ACCESS}"

Expand Down
1 change: 1 addition & 0 deletions test/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ services:
PROXY_CACHE_VALID_OK: "1h"
PROXY_CACHE_VALID_NOTFOUND: "1m"
PROXY_CACHE_VALID_FORBIDDEN: "30s"
PROXY_CACHE_USE_STALE: "error timeout http_500 http_502 http_503 http_504"

minio:
image: quay.io/minio/minio:RELEASE.2023-06-09T07-32-12Z
Expand Down
Loading