From 84278365d065cc018e61845e6fdc7a8a79679d0e Mon Sep 17 00:00:00 2001 From: "Dr. Jens Harbott" Date: Fri, 17 Dec 2021 11:40:51 +0100 Subject: [PATCH] Set CacheMaxExpire to 1h We want to limit the time we remember possibly broken index responses which we sometimes receive from the pypi CDN. We cannot set this per location, so this is a comprise between reducing the impact of bad eggs in the cache and trying not to throw out the good eggs too fast. Change-Id: If88f10cb7e3cebfa9c37a71d284d513f25b8bb52 --- playbooks/roles/mirror/templates/mirror.vhost.j2 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/playbooks/roles/mirror/templates/mirror.vhost.j2 b/playbooks/roles/mirror/templates/mirror.vhost.j2 index 45dbb614e3..f13f9c2f9e 100644 --- a/playbooks/roles/mirror/templates/mirror.vhost.j2 +++ b/playbooks/roles/mirror/templates/mirror.vhost.j2 @@ -51,6 +51,11 @@ ErrorLogFormat "[%{cu}t] [%-m:%l] [pid %P:tid %T] %7F: %E: [client\ %a] %M% , \ # 5GiB CacheMaxFileSize 5368709120 CacheStoreExpired On + # NOTE(frickler): 1h is a compromise between wanting to cache larger + # files for longer, like wheels and tarballs, but reducing the impact + # of broken or outdated index pages which we get delivered from pypi + # CDN sometimes. + CacheMaxExpire 3600 # Pip sets Cache-Control: max-age=0 on requests for pypi index pages. # This means we don't use the cache for those requests. This setting # should force the proxy to ignore cache-control on the request side