Skip to content

Instantly share code, notes, and snippets.

@dex4er
Created February 4, 2013 20:10
Show Gist options
  • Save dex4er/4709313 to your computer and use it in GitHub Desktop.
Save dex4er/4709313 to your computer and use it in GitHub Desktop.
Caching proxy for apt-get
#!/usr/bin/perl -c
# twiggy apt-cache.psgi
use Plack::Builder;
use Plack::App::Proxy;
builder {
enable 'AccessLog';
enable 'Cache',
match_url => ['/dists/', '\.deb$', '/Packages(\.\w+)$'],
cache_dir => '/tmp/apt-cache';
enable 'Proxy::Connect';
enable 'Proxy::AddVia';
enable 'Proxy::Requests';
Plack::App::Proxy->new->to_app;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment