From 130c0a47fc11eef8a57978a792b2aabd9fc1ea68 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Thu, 13 Dec 2018 12:30:43 -0800 Subject: [PATCH] Set CacheIgnoreCacheControl on pypi proxy cache Newer pip sets cache-control: max-age=0 on requests for pypi indexes. This tells the proxy cache not to serve the index content from the cache. Unfortauntely this then means we fail to get this data which could be cached if we can't talk to the backend for some reason. By default pypi seems to set a 600 second max-age on these indexes which should be far better than not caching at all. So set the config to have apache ignore client side max-age and other cache disabling directives. Change-Id: I2da7006dcd8a8f4212f5e766ef35ba7b98177ed0 --- modules/openstack_project/templates/mirror.vhost.erb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/openstack_project/templates/mirror.vhost.erb b/modules/openstack_project/templates/mirror.vhost.erb index bf8187f34f..e1457760a8 100644 --- a/modules/openstack_project/templates/mirror.vhost.erb +++ b/modules/openstack_project/templates/mirror.vhost.erb @@ -53,6 +53,12 @@ LogFormat "%h %l %u %t \"%r\" %>s %b %{cache-status}e \"%{Referer}i\" \"%{User-a # 5GiB CacheMaxFileSize 5368709120 CacheStoreExpired On + # 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 + # but we should still cache things based on the cache-control responses + # from the backed servers. + CacheIgnoreCacheControl On # Added Aug 2017 in an attempt to avoid occasional 502 errors (around # 0.05% of requests) of the type: