Cache queries for each domain when Rails.cache is available