pkg and HTTP caches

Victor Sudakov vas at mpeks.tomsk.su
Fri Nov 27 08:05:18 UTC 2015


Baptiste Daroussin wrote:
> > 
> > While accessing the FreeBSD package database via a corporate HTTP
> > proxy, I have noticed that all fetches are cache misses (see below). I
> > think this is because of the "Cache-Control: max-age=0" directive.
> > 
> > While I can probably understand the reason to never cache repository
> > metadata, I completely fail to see what the problem is with caching
> > packages proper. Taking into account the amount of packages I install
> > and upgrade on several identical systems, caching them would
> > sufficiently save bandwidth.
> > 
> > Any comments please?
> > 
> The problem is some packages can be rebuilt with nothing changing
> (we do not have reproducible build yet) 

This process should result in the modification time of the package
file being updated.

After all, a FreeBSD packages repository is just a Web server serving
static files from the disk, isn't it? At least my personal repository
surely is.

> meaning if you have a cache
> proxy, the proxy might be giving you the old version and not the new
> one resulting in pkg rejecting the package because checksum mismatch
> with what it expects.

Isn't that what we have the "Last-Modified:" HTTP header for? A
caching proxy should consider an object stale if its modification
time on the Web server has changed.

Please correct me if I am wrong.

-- 
Victor Sudakov,  VAS4-RIPE, VAS47-RIPN
sip:sudakov at sibptus.tomsk.ru


More information about the freebsd-pkg mailing list