LWP::UserAgent::Role::CHICaching::SimpleKeyGen(3pm)

LWP::UserAgent::Role::CHICaching::SimpleKeyGen3pm

A role for cache keys when caching lwp::useragent

Usage

See LWP::UserAgent::Role::CHICaching.

Overview

LWP::UserAgent::Role::CHICaching is a role for creating caching user agents. There's some complexity around caching different variants of the same resource (e.g. the same thing in different natural languages, different serializations that is considered in Section 4.1 of RFC7234 <http://tools.ietf.org/html/rfc7234#section-4.1> that this role is factored out to address in the dumbest way possible: Just don't cache when the problem arises.

To really solve this problem in a better way, you need to generate a cache key based on not only the URI, but also on the content (e.g. "Content-Language: en"), and so, provide a better implementation of the "key" attribute, and then, you also need to tell the system when it is OK to cache something with a "Vary" header by making the "cache_vary" method smarter. See LWP::UserAgent::Role::CHICaching::VaryNotAsterisk for an example of an alternative.

Attributes and Methods

"key", "clear_key"

The key to use for a response. This role will return the canonical URI of the request as a string, which is a reasonable default.

"cache_vary"

Will never allow a response with a "Vary" header to be cached.

Releases

5 releases since Debian 9 (Stretch); the text changed 2 times.

  1. 9–10
  2. 11
  3. 12–13

Author

Kjetil Kjernsmo <[email protected]>.

From liblwp-useragent-chicaching-perl 0.04-2 in Debian 13 (Trixie). Parsed by carta from the page's man source.