diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2017-08-01 11:22:27 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2017-08-01 11:36:20 +0300 |
commit | d7399e572e334fb036c7f6b59400f5075147054c (patch) | |
tree | 868c700aa625ab8d413a4191ec3c6cc61b72e5ad /README | |
download | vmod-dict-d7399e572e334fb036c7f6b59400f5075147054c.tar.gz vmod-dict-d7399e572e334fb036c7f6b59400f5075147054c.tar.bz2 |
Initial commit
Diffstat (limited to 'README')
-rw-r--r-- | README | 90 |
1 files changed, 90 insertions, 0 deletions
@@ -0,0 +1,90 @@ +Vmod_dict README +Copyright (C) 2017 Sergey Poznyakoff +See the end of file for copying conditions. + +* Introduction + +This file contains brief information about configuring, testing +and using vmod_dict. It is *not* intended as a replacement +for the documentation, and is provided as a brief reference only. +For accessing complete documentation, please see the section +'Documentation' below. + +* Overview + +This module adds to Varnish Cache the ability to look up values in +a textual dictionary. A dictionary is a disk file containing on +each line a keyword-value pair, separated by arbitrary amount of +whitespace. Leading and trailing whitespace is ignored. Empty lines +and comments (beginning with '#' as the first non-whitespace +character) are allowed. + +The dictionary is loaded into a hash table using the dict.load +function. Normally it is done in vcl_init: + + import dict; + + sub vcl_init { + dict.load("/var/lib/cache/input.dict", false, 0); + } + +The second argument (a boolean) specifies whether the keyword matching +is case-insensitive (true) or case-sensitive (false). The 3rd argument +gives the maximum allowed number of collisions in the loaded hash +table. The module will adjust the load factor to meet this number. + +Once loaded, the value corresponding to a given key can be retrieved +as follows: + + set req.http.X-Value = dict.lookup("key"); + +* Installation + +In order to compile the package you need to have installed +varnishd and varnishapi package. + +Supposing that condition is met, run: + + ./configure + +It should be able to automatically find the necessary components. In case +it doesn't, tweak the configuration variables as necessary. The most +important one is PKG_CONFIG_PATH, which contains a path (in the UNIX sense) +where the .pc files are located. It should contain a directory where the +'varnishapi.pc' file lives. Example usage: + + ./configure PKG_CONFIG_PATH=/usr/local/varnish/lib/pkgconfig:$PKG_CONFIG_PATH + +Please read the file INSTALL for a detailed discussion of available variables +and command line options. + +Once configured, do + + make + +This will build the module. After this step you can optionally run +'make test' to test the package. + +Finally, run the following command as root: + + make install + +* Documentation + +The manual page vmod_dict(3) will be available after a successful +install. To read it without actually installing the module, run +`man src/vmod_dict.3'. + +An online copy of the documentation is available from +http://ps.gnu.org.ua/software/vmod-dict. + +* Bug reporting + +Send bug reports and suggestions to <gray@gnu.org> + + +Local Variables: +mode: outline +paragraph-separate: "[ ]*$" +version-control: never +End: |