Pull requests

#60 Declined
Repository
k_bx
Branch
default
Repository
david
Branch
default

Make exists() check much faster in s3boto backend

Author
  1. Konstantine Rybnikov
Reviewers
Description

Current exists() method gets list of all keys from s3 and then checks if there's a desired name inside, which is crazy.

  • Learn about pull requests

Comments (3)

  1. Konstantine Rybnikov author

    Thanks, Ian.

    You're right, it turns out we had AWS_PRELOAD_METADATA turned on, so I guess this caching ("preload") feature was done by intent, and we should just disable AWS_PRELOAD_METADATA.

    We enabled it before because we wanted to use quote from here http://stackoverflow.com/questions/11569144/proper-way-to-handle-static-files-and-templates-for-django-on-heroku :

    AWS_PRELOAD_METADATA = True # necessary to fix manage.py collectstatic command to only upload changed files instead of all files

    But since our jenkins is cloning and untar'ing repository every time (so timestamps are new for all files), collectstatic command will still sync all the files every time, so we should collect static somehow else (maybe locally + run s3cmd sync somehow).