From owner-freebsd-pkg@freebsd.org Fri Nov 27 08:05:18 2015 Return-Path: Delivered-To: freebsd-pkg@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14219A3A8A6 for ; Fri, 27 Nov 2015 08:05:18 +0000 (UTC) (envelope-from vas@mpeks.tomsk.su) Received: from relay2.tomsk.ru (mail.sibptus.tomsk.ru [212.73.124.5]) by mx1.freebsd.org (Postfix) with ESMTP id D14691F88; Fri, 27 Nov 2015 08:05:16 +0000 (UTC) (envelope-from vas@mpeks.tomsk.su) X-Virus-Scanned: by clamd daemon 0.98.5_1 for FreeBSD at relay2.tomsk.ru Received: from admin.sibptus.TOMSK.ru ([212.73.125.240] verified) by relay2.tomsk.ru (CommuniGate Pro SMTP 5.1.16) with ESMTPS id 38982942; Fri, 27 Nov 2015 14:05:14 +0600 Received: from admin.sibptus.tomsk.ru (sudakov@localhost [127.0.0.1]) by admin.sibptus.TOMSK.ru (8.14.9/8.14.7) with ESMTP id tAR85CDJ091452; Fri, 27 Nov 2015 14:05:14 +0600 (NOVT) (envelope-from vas@mpeks.tomsk.su) Received: (from sudakov@localhost) by admin.sibptus.tomsk.ru (8.14.9/8.14.7/Submit) id tAR85C35091451; Fri, 27 Nov 2015 14:05:12 +0600 (NOVT) (envelope-from vas@mpeks.tomsk.su) X-Authentication-Warning: admin.sibptus.tomsk.ru: sudakov set sender to vas@mpeks.tomsk.su using -f Date: Fri, 27 Nov 2015 14:05:12 +0600 From: Victor Sudakov To: Baptiste Daroussin Cc: freebsd-pkg@freebsd.org Subject: Re: pkg and HTTP caches Message-ID: <20151127080512.GA89598@admin.sibptus.tomsk.ru> References: <20151127031348.GA81677@admin.sibptus.tomsk.ru> <20151127065928.GD939@ivaldir.etoilebsd.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151127065928.GD939@ivaldir.etoilebsd.net> Organization: OAO "Svyaztransneft", SibPTUS X-PGP-Key: http://www.dreamwidth.org/pubkey?user=victor_sudakov X-PGP-Fingerprint: 10E3 1171 1273 E007 C2E9 3532 0DA4 F259 9B5E C634 User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: freebsd-pkg@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Binary package management and package tools discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2015 08:05:18 -0000 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@sibptus.tomsk.ru