title: Python Flask - image proxy
body: <p>I'm looking for a way to get an image from the web and return it to client (without saving to disk first). Something like that (taken from <a href="http://flask.pocoo.org/snippets/118/" rel="nofollow">here</a>):</p>
  
  <pre><code>import requests
  from flask import Response, stream_with_context
  
  @files_blueprint.route('/', methods=['GET'])
  def get_image():  
      req = requests.get('http://www.example.com/image1.png', stream = True)
      return Response(stream_with_context(req.iter_content()), content_type = req.headers['content-type'])
  </code></pre>
  
  <p>Above code is working but its really slow.<br>
  Any better way?</p>