# File lib/rubygems/source_info_cache.rb, line 378
  def write_cache
    if not File.exist?(cache_file) or not @only_latest then
      open cache_file, 'wb' do |io|
        io.write Marshal.dump(cache_data)
      end
    end

    open latest_cache_file, 'wb' do |io|
      io.write Marshal.dump(latest_cache_data)
    end
  end