From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Marusich Subject: Re: Yet another Hydra mirror: hydra-mirror.marusich.info Date: Thu, 10 Mar 2016 20:08:23 -0800 Message-ID: <87d1r1mzbc.fsf@gmail.com> References: <87a8m9jx0z.fsf@gmail.com> <87vb4xnxhl.fsf@gnu.org> <87y49s6opb.fsf@gmail.com> <87fuvzesar.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59558) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aeENH-0001Fm-Bk for guix-devel@gnu.org; Thu, 10 Mar 2016 23:08:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aeENG-00020H-6R for guix-devel@gnu.org; Thu, 10 Mar 2016 23:08:27 -0500 In-Reply-To: <87fuvzesar.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Wed, 09 Mar 2016 13:42:36 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Yeah, mirror.guixsd.org also caches for one week now. I wasn=E2=80=99t s= ure how > much disk space that would represent, but so far we=E2=80=99re around 10G= , so > increasing to 1 week seemed reasonable. Are there any URL paths a caching proxy should NOT cache for a long time? My understanding is that it's OK to cache all URL paths for 1 week. Are there any URL paths for which I should return something different from Hydra (e.g., /nix-cache-info)? > OK. > > Do you know exactly how much is cached? Also, when does caching happen? Every OK result is cached for 7 days. My understanding is that negative results (e.g., 404) are not cached. The storage limit is effectively unlimited from my perspective, since CloudFront is a service. > When using nginx as a proxy as on mirror.guixsd.org, it fetches things > lazily, so on a cache miss it goes connect to hydra.gnu.org. CloudFront operates the same way. >> I've noticed that Hydra does not include cache-related headers (e.g., >> Cache-Control). Perhaps for this reason, the nginx config you linked >> seems to pick arbitrary caching settings. When using CloudFront, a >> distribution can be configured to respect the Cache-Control headers sent >> by the origin server. Does nginx provide similar functionality? Would it >> make sense to have hydra.gnu.org return such headers? > > Dunno, maybe! Maybe we could tell nginx to add such headers? What > would be the right thing? I'm not sure. It's obviously not necessary, but if the common proxy servers (e.g., nginx) obey such cache control headers by default, it might be nice to return the headers. That way, Hydra could "recommend" caching behavior, and it would be easier to set up a correctly functioning caching proxy. However, if servers like nginx don't obey cache control headers by default, or if Hydra does not require different objects to be cached differently, it may not worth the effort. Chris