Purge varnish via bans. Work in pair with https://github.com/hellvinz/purgerd
Add this line to your application's Gemfile:
gem 'purger'
And then execute:
$ bundle
Or install it yourself as:
$ gem install purger
The purger in a singleton that you need to configure via config! (be sure to put the same address as in purgerd)
To issue a purge call the method purge with a pattern (that varnish bans understand)
require 'purger'
purger = Purger.instance
purger.config!('127.0.0.1', '8080') unless purger.configured
error = purger.purge(".*.jpg")
puts 'purged!' unless error
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request