#836 proxies: fix ETag handling for pkgdb json file
Merged 3 years ago by kevin. Opened 3 years ago by kevin.
Unknown source fix-pkgdb-etag  into  main

@@ -1,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.

+ #

+ <Files pkgdb-gnome-software-collections.json>

+ FileETag Size Digest

+ </Files>

  AliasMatch ^/pkgdb/api/collections/? /srv/web/pkgdb-gnome-software-collections.json

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 kevin@scrye.com

This is a pretty small change and would help us out, so I guess it might be nice to push as a freeze break. Any +1s?

:thumbsup: for me

Easy enough to test and rollback if needed as well

+1, I dont know about ETag but it can be reversed if it didn't work.

rebased onto 3e96264

3 years ago

rebased onto 3e96264

3 years ago

It's basically a hash thats sent back as a header to requests. If any of the things that go into the hash (by default Mtime and Size) changes the tag also changes.

This allows applications to say 'get this file, unless the etag hasn't changed since the last time we got the file' and just get the headers and a 304 (not modified) instead of downloading the entire file and then throwing it away because you already had it. ;)

Pull-Request has been merged by kevin

3 years ago
Metadata