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

an idea for next generation APT archive caching



Here's an idea I just had about apt-proxy/apt-cacher NG. Maybe this
could be interesting, maybe it's just crap. Your call.

Based on a normal mirror layout, the idea is to use apache's 404
hook for packages. When an existing package is requested, it is
served regularly. If the file is not found, a 404 is triggered,
which can be served by a CGI-like thingie that goes to retrieve the
package, returns 200 instead of 404 and streams the package as the
404 error document contents while writing it to the filesystem
(tee(1) style).

For Release, Package, Sources, and Contents files, we need
a RewriteRule. When one of these is is accessed, a call to a mirror
should be made to check for updates. If there is one, download it
and stream it.

How do you send the newly retrieved file instead of the static file
present on the filesystem? Essentially, this is the only need for
a proxy, which could be implemented with a RewriteRule and a CGI. Or
maybe apache can do this somehow?

I think this would be an extremely simple implementation, using the
proven apache for most of the work (and not the buggy twisted module
that apt-proxy uses). Thus, the entire thing is reduced to a couple
of httpd.conf entries and two extremely simple (?) CGIs.

In addition, a cronjob runs daily to purge all files in the
filesystem space, which are not referenced from any of the
Packages/Sources files.

This is a braindump. Please comment. Am I missing something? Would
someone like to try this? I really don't have the time right now...

-- 
Please do not CC me when replying to lists; I read them!
 
 .''`.     martin f. krafft <madduck@debian.org>
: :'  :    proud Debian developer, admin, and user
`. `'`
  `-  Debian - when you have better things to do than fixing a system
 
Invalid/expired PGP subkeys? Use subkeys.pgp.net as keyserver!

Attachment: signature.asc
Description: Digital signature


Reply to: