.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "LWP::UserAgent::CHICaching 3pm" .TH LWP::UserAgent::CHICaching 3pm "2022-05-28" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" LWP::UserAgent::CHICaching \- LWP::UserAgent with caching based on CHI .SH "SYNOPSIS" .IX Header "SYNOPSIS" The usual way of using LWP::UserAgent, really, just pass a \f(CW\*(C`cache\*(C'\fR parameter with a \s-1CHI\s0 object to the constructor: .PP .Vb 3 \& my $cache = CHI\->new( driver => \*(AqMemory\*(Aq, global => 1 ); \& my $ua = LWP::UserAgent::CHICaching\->new(cache => $cache); \& my $res1 = $ua\->get("http://localhost:3000/?query=DAHUT"); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is \s-1YA\s0 caching user agent. When the client makes a request to the server, sometimes the response should be cached, so that no actual request has to be sent at all, or possibly just a request to validate the cache. \s-1HTTP 1.1\s0 defines how to do this. This class simply extends LWP::UserAgent with LWP::UserAgent::Role::CHICaching (also in this distribution) which is doing the real work to make it possible to use the very flexible \s-1CHI\s0 module to manage such a cache. .PP But why? Mainly because I wanted to use \s-1CHI\s0 facilities, and partly because I wanted to focus on \s-1HTTP 1.1\s0 features. .SH "TODO" .IX Header "TODO" This is an early release, but it supports \s-1RFC7234\s0 quite well already. Much work remains though. These are the things that I'd like to do: .IP "\(bu" 4 Enable smarter generation of keys, so that semantically identical content can be cached efficiently even though they may have different URIs. This can be done in a separate role with the current code. .IP "\(bu" 4 Support all of \s-1RFC7234\s0 and \s-1RFC7232\s0 .SH "AUTHOR" .IX Header "AUTHOR" Kjetil Kjernsmo . .SH "COPYRIGHT AND LICENCE" .IX Header "COPYRIGHT AND LICENCE" This software is copyright (c) 2015, 2016 by Kjetil Kjernsmo. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. .SH "DISCLAIMER OF WARRANTIES" .IX Header "DISCLAIMER OF WARRANTIES" \&\s-1THIS PACKAGE IS PROVIDED \*(L"AS IS\*(R" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.\s0