Hello fellow monks,
I am seeking information with respect to HTTP::Proxy capability to dish out files I have stored in a local cache. The context for the files being dished out is as follows:
1. Use a self written LWP agent to collect web resources and store the files to cache area (already completed)
2. Store headers of resources in same area (already completed)
I want to start with the following but add filters so I can push already stored content back to clients, otherwise, allow them to perform a passthrough and pull content from sites. I have no intention of caching content that I don't already have cached. If the client performs passthrough to site, the content is not stored at all.
use HTTP::Proxy;
# initialisation
my $proxy = HTTP::Proxy->new( port => 3128 );
# alternate initialisation
my $proxy = HTTP::Proxy->new;
$proxy->port( 3128 ); # the classical accessors are here!
# this is a MainLoop-like method
$proxy->start;
I have been testing HTTP::Proxy more and more and like how it works with complex sites, too. I already have tens of millions of resources in the cache, so I would prefer not to have to refetch all the resources. I have absolutely no experience setting up or writing HTTP::Proxy filters. So, if there is a way I can get this to work, it would be most appreciated.
Thanks in advance for your help.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.