# File lib/rbot/core/utils/httputil.rb, line 654
  def remove_stale_cache
    debug "Removing stale cache"
    now = Time.new
    max_last = @bot.config['http.expire_time'] * 60
    max_first = @bot.config['http.max_cache_time'] * 60
    debug "#{@cache.size} pages before"
    begin
      @cache.reject! { |k, val|
        (now - val.last_used > max_last) || (now - val.first_used > max_first)
      }
    rescue => e
      error "Failed to remove stale cache: #{e.pretty_inspect}"
    end
    debug "#{@cache.size} pages after"
  end