Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/csfrancis/libvmod-redis
An example vmod for Varnish
https://github.com/csfrancis/libvmod-redis
Last synced: 3 months ago
JSON representation
An example vmod for Varnish
- Host: GitHub
- URL: https://github.com/csfrancis/libvmod-redis
- Owner: csfrancis
- License: other
- Fork: true (zephirworks/libvmod-redis)
- Created: 2013-07-16T11:29:12.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2013-07-16T13:28:27.000Z (almost 11 years ago)
- Last Synced: 2024-03-31T09:07:09.893Z (3 months ago)
- Language: C
- Homepage: http://www.varnish-cache.org/project/modules
- Size: 73.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-varnish - A Varnish module that allows sending commands to redis from the VCL
README
vmod-redis
==========A Varnish module that allows sending commands to redis from the VCL.
At this stage it is mostly a proof-of-concept; it has only received minimal
testing and we have never used it in production. At the very minimum, it will
slow down Varnish a fair amount (at least a few milliseconds per request,
depending on how fast your network and your redis server are).So far the module builds and runs on FreeBSD--on other platforms, you are on your own (pull requests welcome).
Functions and procedures
------------------------*redis.init_redis(host, port, timeout_ms)*
Use the redis server at the given _host_ and _port_ with a timeout
of _timeout__ms_ milliseconds.
If _port_ is less than or equal to zero, the default port of 6379 is used.
If _timeout__ms_ is less than or equal to zero, a default timeout of 200ms is used.This function is supposed to be called from the Varnish subroutine _vcl__init_.
If the call is left out, the module will attempt to connect to the Redis server
at 127.0.0.1:6379 with a connect timeout of 200ms.*redis.send(command)*
Sends the given _command_ to redis; the response will be ignored.
*redis.call(command)*
Sends the given _command_ to redis; any response will be returned as a string.
Dependencies
------------* hiredis (https://github.com/antirez/hiredis)
Building
--------* ./autogen.sh
* make
* sudo make installConfiguration
-------------See the _examples_ folder.