public
Description: klarlack is a ruby client library for the varnish administration interface. It allows, among other things, purging of cached objects from ruby code.
Homepage: http://github.com/schoefmax/klarlack
Clone URL: git://github.com/schoefmax/klarlack.git
name age message
file .document Fri Apr 03 12:07:45 -0700 2009 Initial commit to klarlack. [schoefmax]
file .gitignore Fri Apr 03 12:07:45 -0700 2009 Initial commit to klarlack. [schoefmax]
file LICENSE Fri Apr 03 12:07:45 -0700 2009 Initial commit to klarlack. [schoefmax]
file README.rdoc Mon Nov 16 01:23:01 -0800 2009 moving to gemcutter.org [schoefmax]
file Rakefile Thu Apr 23 05:54:41 -0700 2009 first commit [schoefmax]
file VERSION.yml Tue Dec 08 00:02:47 -0800 2009 Version bump to 0.0.0 [schoefmax]
file klarlack.gemspec Tue Dec 08 00:05:37 -0800 2009 bumping version [schoefmax]
directory lib/ Tue Dec 08 00:05:37 -0800 2009 bumping version [schoefmax]
directory spec/ Mon Dec 07 15:33:16 -0800 2009 properly escape backslashes in parameters [schoefmax]
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 (from gemcutter.org)

  sudo gem install klarlack

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?

dict.leo.org/?search=klarlack

Copyright

Copyright © 2009 Max Schöfmann. Distributed under the MIT-License