0.0
No commit activity in last 3 years
No release in over 3 years
Adds PURGEDOMAIN to Net::HTTP for domain-level cache purging requests.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

net-purgedomain

Adds PURGEDOMAIN to Net::HTTP for domain-level cache purging requests in Varnish.

Installation:

gem 'net-purgedomain', '~> 1.0'

Example Use

require 'net-purge'

Net::HTTP.start('cacheserver.com') { |http|
    # You can specify any path you want, it's ignored
    request = Net::HTTP::PurgeDomain.new('/')
    response = http.request(request)
    puts response.body # Guru Meditation
}

If you'd like to specify a specific domain to purge that's different from your caching server:

Net::HTTP.start('cacheserver.com') do |http|
    # You can specify any path you want, it's ignored
    request = Net::HTTP::PurgeDomain.new('/')
    request.initialize_http_header({ "Host" => "domain.to.purge.com" })
    response = http.request(request)
    puts response.body # Guru Meditation
end