From 3e9626416caf2fa63c1666bd75d8c17d3824e8b6 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Tue, 19 Oct 2021 14:42:58 -0700 Subject: [PATCH] proxies: fix ETag handling for pkgdb json file We maintain a static json file for gnome-software (and others) that tells them when new releases are available. This file gets downloaded a LOT. Right now because this file is spread out on all our proxies and the default ETag uses MTime in it, they all return different ETag values, making it impossible to use ETags to not have to re-download the file. Setting it to use just Size and Digest for this file means all the proxies will have the same ETag and gnome-software can see that and not download the file over and over if it's not changed. Signed-off-by: Kevin Fenzi --- roles/pkgdb-proxy/files/pkgdb-gnome-software.conf | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/roles/pkgdb-proxy/files/pkgdb-gnome-software.conf b/roles/pkgdb-proxy/files/pkgdb-gnome-software.conf index 2c7e1946db..a2c87b14a1 100644 --- a/roles/pkgdb-proxy/files/pkgdb-gnome-software.conf +++ b/roles/pkgdb-proxy/files/pkgdb-gnome-software.conf @@ -1 +1,9 @@ +# +# Do not use MTime for the ETag here, because the mtime of the file +# on the different proxies makes them return different ETags +# Instead use Digest and Size to tell when the file has changed. +# + +FileETag Size Digest + AliasMatch ^/pkgdb/api/collections/? /srv/web/pkgdb-gnome-software-collections.json