Created
January 12, 2010 14:35
-
-
Save jfahrenkrug/275240 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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