[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [PATCH 1/1] snapshot::web Fix internal redirects to farm



On Wed, 2024-11-20 at 14:07 +0100, Philipp Kern wrote:
> Hi,
> 
> On 2024-11-20 13:23, MOESSBAUER, Felix wrote:
> > > apt-cacher-ng sends a distinctive User-Agent:
> > > 
> > > > 127.0.0.1 - - [20/Nov/2024:01:03:38 +0000] "GET
> > > > /archive/debian/20180325T111329Z/dists/stretch/contrib/i18n/Tra
> > > > nsla
> > > > tion-en HTTP/1.1" 404 2203 25ms "-" "Apt-Cacher-NG/3.6.4"
> > > 
> > > Should we try to just reply differently to that User-Agent and
> > > DTRT
> > > for
> > > it? And then set "Vary: User-Agent" in the response?
> > 
> > We could, but where? In Varnish or in the flask app by not sending
> > the
> > redirect but serving the file directly?
> 
> Good question. I had Varnish in mind because it can easily retry the 
> request - and already does. I don't know of a way of doing this in 
> Apache. I think it'd be mostly trivial with nginx, but right now we
> are 
> stuck with Apache.

I had to re-learn Apache rules again as I'm also an Nginx user.
Felt a bit like traveling 10 years into the past.

> 
> I.e. we could do literally what you suggested but key it off the 
> User-Agent and set the Vary header?

Technically we can, but this significantly reduces the caching on
Fastly, as we can't encode "cache for all, except if this user-agent".

I have no idea how to properly resolve this. If someone more familiar
with HTTP caching is reading this, please speak up.

Felix

-- 
Siemens AG, Technology
Linux Expert Center



Reply to: