07 Mar 2016 10:32:14 UTC
- Distribution: LWP-UserAgent-CHICaching
- Module version: 0.04
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (2)
- Testers (1765 / 6 / 0)
- KwaliteeBus factor: 1
- 100.00% Coverage
- License: perl_5
- Perl: v5.6.0
- Download (19.7KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
LWP::UserAgent::CHICaching - LWP::UserAgent with caching based on CHI
my $cache = CHI->new( driver => 'Memory', global => 1 ); my $ua = LWP::UserAgent::CHICaching->new(cache => $cache); my $res1 = $ua->get("http://localhost:3000/?query=DAHUT");
This is YA 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. HTTP 1.1 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 CHI module to manage such a cache.
But why? Mainly because I wanted to use CHI facilities, and partly because I wanted to focus on HTTP 1.1 features.
This is an early release, but it supports RFC7234 quite well already. Much work remains though. These are the things that I'd like to do:
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.
Kjetil Kjernsmo <firstname.lastname@example.org>.
This software is copyright (c) 2015, 2016 by Kjetil Kjernsmo.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
Module Install Instructions
To install LWP::UserAgent::CHICaching, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install LWP::UserAgent::CHICaching
For more information on module installation, please visit the detailed CPAN module installation guide.
|s||Focus search bar|
|?||Bring up this help dialog|
|g p||Go to pull requests|
|g i||go to github issues (only if github is preferred repository)|
|g a||Go to author|
|g c||Go to changes|
|g i||Go to issues|
|g d||Go to dist|
|g r||Go to repository/SCM|
|g s||Go to source|
|g b||Go to file browse|