Created
February 4, 2013 20:10
-
-
Save dex4er/4709313 to your computer and use it in GitHub Desktop.
Caching proxy for apt-get
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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