summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2013-10-08 14:13:35 +0100
committerSteve Kemp <steve@steve.org.uk>2013-10-08 14:13:35 +0100
commita209c9892956fa71321fd439501cef289e16cec4 (patch)
tree76ba969f695a87ce6aff471aadea412e981ed6f7
parent7e57f032547bb40bc8a9cd7a5900a9a0e6f4a0ad (diff)
Attempt to avoid caching artifacts on all URL-testing by
appending ?ctime=XX to HTTP/HTTPS-requests.
-rw-r--r--debian/changelog6
-rw-r--r--lib/custodian/protocoltest/http.rb20
2 files changed, 25 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index 4406dc4..bf3f249 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+custodian (0.10-9) stable; urgency=low
+
+ * Add ?ctime=XX to all URL-probes, to break caching.
+
+ -- Steve Kemp <steve@bytemark.co.uk> Tue, 08 Oct 2013 14:13:12 +0000
+
custodian (0.10-8) stable; urgency=low
* Send graphite updates via UDP to localhost:2003.
diff --git a/lib/custodian/protocoltest/http.rb b/lib/custodian/protocoltest/http.rb
index c52e36c..c9aedaf 100644
--- a/lib/custodian/protocoltest/http.rb
+++ b/lib/custodian/protocoltest/http.rb
@@ -191,10 +191,28 @@ module Custodian
settings = Custodian::Settings.instance()
period = settings.timeout()
+ #
+ # The URL we'll fetch, which has a cache-busting
+ # query-string
+ #
+ test_url = @url
+
+ #
+ # Parse and append a query-string if not present.
+ #
+ u = URI.parse( test_url )
+ if ( ! u.query )
+ u.query = "ctime=#{Time.now.to_i}"
+ test_url = u.to_s
+ end
+
+
begin
timeout( period ) do
begin
- c = Curl::Easy.new(@url)
+
+
+ c = Curl::Easy.new(test_url)
#
# Should we follow redirections?