The information comes partly from rfc2068 and then how that is implemented in LWP::UserAgent (using HTTP::Headers) to modify the request header.
In compliance with HTTP 1.0 the request needs to send a 'Pragma: no-cache' in the request header.
With HTTP 1.1 the preferred method is to include a 'Max-Age = 0' in the request header, though the 'no-cache [fields]' directive is also supported.
When using LWP::UserAgent this is implemented by using the headers function like so:
use HTTP::Request::Common;
use LWP::UserAgent;
my $ua = new LWP::UserAgent;
$ua->proxy('http', "$proxy:$proxy_port"
;
my $req = new HTTP::Request('GET', "$url"
;
$req->header('pragma' => 'no-cache', #HTTP 1.0 header
'max-age' => '0'); #HTTP 1.1 header
my $request = $req->as_string(); #contains the full request
my $html = $ua->request($req)->as_string; #contains the returned html
This assumes $proxy, $proxy_port and $url are all defined earlier.
(written by Wyzelli -
In compliance with HTTP 1.0 the request needs to send a 'Pragma: no-cache' in the request header.
With HTTP 1.1 the preferred method is to include a 'Max-Age = 0' in the request header, though the 'no-cache [fields]' directive is also supported.
When using LWP::UserAgent this is implemented by using the headers function like so:
use HTTP::Request::Common;
use LWP::UserAgent;
my $ua = new LWP::UserAgent;
$ua->proxy('http', "$proxy:$proxy_port"
my $req = new HTTP::Request('GET', "$url"
$req->header('pragma' => 'no-cache', #HTTP 1.0 header
'max-age' => '0'); #HTTP 1.1 header
my $request = $req->as_string(); #contains the full request
my $html = $ua->request($req)->as_string; #contains the returned html
This assumes $proxy, $proxy_port and $url are all defined earlier.
(written by Wyzelli -