pacredir icon indicating copy to clipboard operation
pacredir copied to clipboard

Stop returning 404 by providing a local reverse-proxy

Open MayeulC opened this issue 5 years ago • 3 comments

Those 404 when a package isn't in the network cache can get annoying. I would suggest providing (at least as an option) a reverse-proxy to the default mirror (that could be specified explicitly in pacredir's configuration, or maybe obtained automatically as well).

For now, the 404s can be informative, but you might as well get this information for the download speed, and I systematically get them when updating on the go with my laptop.

Thanks for this awesome way of speeding up upgrades over my slow connection, this is exactly what I was looking for :heart:

MayeulC avatar Aug 19 '18 07:08 MayeulC

I've thought of getting rid of the 404s myself. Sadly it's not that easy.

The database and package cache is just flat, there's no architecture, repository name or extra path. I could allow to give extra path and just strip it when redirecting to pacserve. But where to get the first mirror? pacredir.conf? pacman.conf? First would add duplicate configuration, second would add even more extra complexity as configuration supports includes and different mirrors for repositories. And the path given to pacredir has to match the mirrors' path.

Please elaborate if I got you wrong, but I think this is not an easy task and not worth the trouble just to get rid of some messages.

I thought about doing it the other way round: Instead of returning 404 pacredir could use something like 204 (No Content). Then pacman should recognize this as "soft failure", just ignore it without error messages and skip to the next mirrors. I've not contacted upstream about it nor prepared any patches. Currently pacman interprets all 20x codes as success without further action.

eworm-de avatar Aug 23 '18 21:08 eworm-de

Hi, you ate right regarding the added complexity regarding configuration, I thought about this too. Both solutions have obvious drawbacks, but perhaps that could be worked around with upstream? If pacman.conf supported a "package cache" URL, that would help a lot. I could ask them, if you want.

MayeulC avatar Aug 24 '18 07:08 MayeulC

BTW, there is a related issue for pacman: FS#23407 - Allow soft failures on Server URLs

Perhaps investigating there makes sense.

eworm-de avatar Aug 24 '18 08:08 eworm-de