django-storages
django-storages copied to clipboard
`collectstatic` is extremely slow with S3 Manifest
hiya! I'm deploying my app on DigitalOcean App Platform. As part of the build step there, I run python manage.py collectstatic --noinput
. Before switching to storing my static assets in a S3-compatible bucket this was instant, but now takes over 10 minutes when using the S3 manifest. The S3-compatible service I am using is Backblaze B2, although I wouldn't expect this to matter.
Configuration for my static files
storages.py
class StaticStorage(S3ManifestStaticStorage):
bucket_name = 'splashcat-static'
custom_domain = 'static.splashcat.ink'
settings.py
if not DEBUG:
STORAGES = global_settings.STORAGES | {
"default": {"BACKEND": "storages.backends.s3boto3.S3Boto3Storage"},
"staticfiles": {"BACKEND": "splashcat.storages.StaticStorage"}
}
@catgirlinspace I am experiencing this too, did you find a solution?
I ended up doing this.
python -m cosmos.manage collectstatic --no-input & # background the static collection
gunicorn cosmos.cosmos_site.wsgi --config cosmos/gunicorn_conf.py
@DuncanTormey hi, sorry for the late reply. my workaround for this was to just use collectstatic and serve it without S3 and then stick a CDN in front.
I'm also experiencing a 10 minute duration when trying to upload ~2,700 files
+1