Faster alternative to manage.py collectstatic (w/ s3boto storage backend) to sync static files to s3?

后端 未结 2 1207
夕颜
夕颜 2021-02-04 08:39

I have been using s3boto\'s S3BotoStorage as my static files backend and syncing files to my aws s3 buckets (staging and production) using ./manage.py collectstatic. It works fi

相关标签:
2条回答
  • 2021-02-04 09:11

    I wrote a pluggable Django app, based on a djangosnippet, that caches the ETag of the remote file and compares the chached checksum instead of performing a lookup every time. It took me from about 1m30s to around 10s per call to manage.py collectstatic for a few hundred static files. Check it out here: https://github.com/antonagestam/collectfast

    0 讨论(0)
  • 2021-02-04 09:34

    Set AWS_PRELOAD_METADATA to True in your settings so it pre-loads all files on s3 before syncing and only syncs the ones that are not already there (or have changed).

    0 讨论(0)
提交回复
热议问题