This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
phillc (author)
Wed Nov 04 11:57:43 -0800 2009
commit 2bc23ac73f2a33b698d697ae91d653475a1c6028
tree 0604f73286501e850209e37b12aa89c04761ad0a
parent 33338ca308818d68ad5a684323a6d184526af11f
tree 0604f73286501e850209e37b12aa89c04761ad0a
parent 33338ca308818d68ad5a684323a6d184526af11f
klarlack /
| name | age | message | |
|---|---|---|---|
| |
.document | Fri Apr 03 12:07:45 -0700 2009 | |
| |
.gitignore | Fri Apr 03 12:07:45 -0700 2009 | |
| |
LICENSE | Fri Apr 03 12:07:45 -0700 2009 | |
| |
README.rdoc | ||
| |
Rakefile | Thu Apr 23 05:54:41 -0700 2009 | |
| |
VERSION.yml | Fri Apr 24 02:35:54 -0700 2009 | |
| |
klarlack.gemspec | Fri Apr 24 02:35:54 -0700 2009 | |
| |
lib/ | ||
| |
spec/ | Fri Apr 24 02:35:54 -0700 2009 |
README.rdoc
klarlack
Klarlack is a ruby client library for the varnish administration interface.
See also: www.varnish-cache.org
Please note: You need at least version 2.0.3 of varnish for purging to work.
Installation
sudo gem install schoefmax-klarlack --source=http://gems.github.com
Example
Lets purge all blog posts from the cache…
require 'rubygems' require 'klarlack' varnish = Varnish::Client.new '127.0.0.1:6082' # the regexp is not a ruby regexp, just a plain string varnishd understands varnish.purge :url, "^/posts/.*"
In a Rails app, you might want to use use this in a cache sweeper.
Specs
Start up a local varnishd with -T 127.0.0.1:6082. Then run
spec spec
TODO
- Support authentication when varnishd is started with -S
- Make parameter manipulation/display more friendly
WTF?
MClient
config/varnish.yml
development:
cache1:
port: 6082
host: localhost
test:
cache1:
port: 6082
host: localhost
production:
cache1:
port: 6082
host: localhost
cache2:
port: 6083
host: 127.0.0.1
Lets purge all blog posts from all cache servers…
require 'rubygems'
require 'klarlack'
>> varnish = Varnish::MClient.new
=> #<Varnish::MClient:0x26c9fc4 @config={:cache2=>{"port"=>6083, "host"=>"127.0.0.1"}, :cache1=>{"port"=>6082, "host"=>"localhost"}}, @servers={:cache2=>#<Varnish::Client:0x26c0668 @keep_alive=false, @timeout=1, @mutex=#<Mutex:0x26c0564>, @port=6083, @host="127.0.0.1">, :cache1=>#<Varnish::Client:0x26c04c4 @keep_alive=false, @timeout=1, @mutex=#<Mutex:0x26c03d4>, @port=6082, @host="localhost">}>
>> varnish.purge :url, "^/posts/.*"
=> {:cache2=>true, :cache1=>true}
Copyright
Copyright © 2009 Max Schöfmann. Distributed under the MIT-License Modified by Phillip Campbell








