Module kvarn::vary

source ·
Expand description

Vary header handling in Kvarn.

You (as a user of Kvarn or extension author), can add rules for headers which caches the response depending on their values.

Indexed by request headers, which are modified by callbacks, specific to each header.

See the example at Vary for an example implementation where we have two pages, one in English and one in Swedish. They are served depending on the user’s preference. All the responses are cached, so the Prepare extension will be called at most once.


  • The rules for handling and caching a request/response.
  • A collection of multiple responses depending on the headers the client sent, according to the vary header.

Type Definitions

  • A set of rules for the vary header.