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

Re: an idea for next generation APT archive caching



also sprach Michelle Konzack <linux4michelle@freenet.de> [2004.10.20.1107 +0200]:
> Because in Apache you can manipulate Error-Messages, it is
> possibel. The problem is only the TimeOut of 'apt-get' if the
> requested Server is not fast enough.

That's why there should be streaming going on. This has been my
major problem with apt-cacher, which I am trying to solve...

> I hve done this already in a php-Script, but unfortunatly my
> apt-404-proxy-cgi does download the File and then forward it to
> apt-get.

Yeah, this is not ideal. However, I think it would be trivial to
implement. Here's the pseudo-code. I assume that $RPATH and $LPATH
contain the path appended to a mirror and $LPATH the local
filesystem path. $MIRROR is a mirror. These variables should be set
from the CGI environment as much as possible, and MIRROR comes from
a conffile. And: this is shell... :)

#!/bin/sh -e

echo 200 OK
echo Content-type: application/x-debian-package
echo

exec wget -O - $MIRROR/$RPATH | tee $LPATH

Would this work?

> Hmmm for those files I have a cronjob, so there are allways the 
> newest versions availlable.

This is also a possibility, but will be hard to get in sync properly
with the mirrors...

> > 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?
> 
> ???  -  'apache' allow to use CGI to serve Errors.

I am almost sure it does.

> If an error occurs, the Refer URL is paste to the Error-404-CGI. 
> and while the CGI download the file from a Debian-Mirror, it can
> stream the Error-404 as "application/x-debian-package" while
> rewriting the HTTP-Header from 404 to 200.

See above.

-- 
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: