My Rails 3.2 app contains a health check route for an upstream load balancer:
# routes.rb
get 'health' => lambda { |env| [200, {"Content-Type" => 'application/json'}, [ 'Alive.' ] ] }
I am also using Dalli and memcached to cache various objects in my application. I have been using the Dalli debugging output recently and notice that my logs are flooded with health checks:
# application.rb
config.cache_store = :dalli_store, "localhost:11211", { :compress => true, :expires_in => 1.day }
Dalli.logger = Logger.new("#{Rails.root}/log/#{Rails.env}_cache.log")
Dalli.logger.level = Logger::DEBUG
# development_cache.log
[DEBUG] Cache read: http://mysite.com/health/?
[DEBUG] Cache read: https://mysite.com:80/health/?
[DEBUG] Cache read: http://mysite.com/health/?
[DEBUG] Cache read: https://mysite.com:80/health/?
[DEBUG] Cache read: http://mysite.com/health/?
[DEBUG] Cache read: https://mysite.com:80/health/?
....
Are these health checks being served from the cache for some reason? Where is that configured? I have obviously not set up page caching. This route is the only code whatsoever associated with that URL.