You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, I would hesitate to use that, as it would be the default for all uploads, not just those that use unique filenames, and we probably only want to use it when using unique filename storage. It would probably be best to add a new mixin:
Speaking of the list of mixins above, note UniqueMixin followed by S3GetContentHashMixin. The only functionality the latter provides is an overridden get_content_hash() method. However, UniqueMixin also overrides get_content_hash(), and doesn't call super() within it, so the functionality of S3GetContentHashMixin is never invoked. I'm not sure what the history of that mixin is and what it's trying to accomplish, so I don't have any specific suggestions other than for someone with more contextual knowledge to review the situation and either make its functionality invokable, or remove it altogether.
The text was updated successfully, but these errors were encountered:
@Aramgutang Thanks, this was recently brought to my attention again and I finally got around to looking at it. You are indeed correct, the order of the mixins is reversed. Just switching them so S3GetContentHashMixin is before UniqueMixin should be all that is needed.
You are probably also correct about the expiry settings. However we are now using R2 instead of S3 and I don't think it supports the per object expiry, and we handle this in our Cloudflare worker which provides public and private access to the R2 bucket.
But your suggestion does seem reasonable for S3 buckets.
There are numerous issues with the way storages are set up in ixc-django-docker.
For starters, this:
ixc-django-docker/ixc_django_docker/settings/storages.py
Lines 4 to 7 in bcf550f
Per the current django-storages docs, that actually has no effect, since it's only used with boto, not boto3, and we use the latter.
The suggested way to define a never-expire cache instead is via object parameters (also note the use of a properly large
max-age
):However, I would hesitate to use that, as it would be the default for all uploads, not just those that use unique filenames, and we probably only want to use it when using unique filename storage. It would probably be best to add a new mixin:
And then add that to the list of mixins when constructing the unique storages:
ixc-django-docker/ixc_django_docker/storage.py
Lines 137 to 152 in bcf550f
Speaking of the list of mixins above, note
UniqueMixin
followed byS3GetContentHashMixin
. The only functionality the latter provides is an overriddenget_content_hash()
method. However,UniqueMixin
also overridesget_content_hash()
, and doesn't callsuper()
within it, so the functionality ofS3GetContentHashMixin
is never invoked. I'm not sure what the history of that mixin is and what it's trying to accomplish, so I don't have any specific suggestions other than for someone with more contextual knowledge to review the situation and either make its functionality invokable, or remove it altogether.The text was updated successfully, but these errors were encountered: