Skip to content

Instantly share code, notes, and snippets.

@jfahrenkrug
Created January 12, 2010 14:35
Show Gist options
  • Save jfahrenkrug/275240 to your computer and use it in GitHub Desktop.
Save jfahrenkrug/275240 to your computer and use it in GitHub Desktop.
# 2010, Johannes Fahrenkrug, http://springenwerk.com
# Run it like this:
# ruby script/runner clear_diskcache.rb http://mysite.com/some/page http://mysite.com/some/other/page
if ARGV.size < 1
puts "Please supply one or more URLs!"
exit
else
ms = Radiant::Cache::MetaStore.new
ARGV.each do |url|
if url !~ /^http:\/\//
url = "http://#{url}"
end
# Rack::Cache adds a ? to the end of all the url-cache-keys
url += "?"
puts "Removing #{url} from the cache..."
ms.purge(url)
end
puts "Done."
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment