title: django AWS S3 download optimisation
body: <p>I work on some django + DRF project, that has application for media files upload to and download from AWS S3 (application is something like proxy, using to not access frontend to download images directly from AWS S3). I noticed, that my download requests work not so fast (500ms +/- 100ms), and in production it probably will be a problem, so my question is following: <code>&quot;Is there a way to make these requests faster or separate download logic to some async microservice or multiprocess task? What is the best practice?&quot;</code></p>
  <p>Service, that download images for me in current project state (for context):</p>
  <pre class="lang-py prettyprint-override"><code>
  # media_app/services/download/image.py
  class ImageDownloadService(FileDownloadServiceBase):
      model = Image
  
  
  # media_app/services/download/base.py
  class FileDownloadServiceBase:
      model = ...
  
      def __init__(self, instance: str) -&gt; None:
          self.instance = instance
  
      def _get_file(self, presigned_url):
          response = requests.get(url=presigned_url, stream=True)
          return response
  
      def download(self) -&gt; Tuple[file_data, status_code]:
          s3 = boto3.resource(
              service_name='s3',
              aws_access_key_id=settings.AWS_ACCESS_KEY_ID,
              aws_secret_access_key=settings.AWS_SECRET_ACCESS_KEY,
              region_name=settings.AWS_S3_REGION_NAME,
          )
          url = s3.meta.client.generate_presigned_url(
              ClientMethod=&quot;get_object&quot;, ExpiresIn=3600,
              Params={
                  &quot;Bucket&quot;: settings.AWS_STORAGE_BUCKET_NAME,
                  &quot;Key&quot;: f'media/public/{self.instance.file_name}',
              },
          )
          response = self._get_file(url)
          return response.content, response.status_code
  </code></pre>