theriverman/django-minio-backend

Beyond MINIO_URL_EXPIRY_HOURS, cache duration?

Closed this issue · 2 comments

j2l commented

Hello,
Finally a django minio project that works! Thank you very much!

With a very small MINIO_URL_EXPIRY_HOURS, I can get Request Expired from new client, but I noticed that client with former access still have the file in the browser cache.
I wonder if a django-minio-backend function or minio/python/django trick could set the cache based on MINIO_URL_EXPIRY_HOURS.

Side question: After expiry, is there an automatic way to generate another signed URL for the file using django-minio-backend?

Thank you

Hi,
This package is just a wrapper around https://github.com/minio/minio-py.

The value of MINIO_URL_EXPIRY_HOURS is passed to the underlying minio api:
https://github.com/minio/minio-py/blob/ffe9045fc8bdb435c02054336c79670ed61704a1/minio/api.py#L2289

In this scenario Django does nothing but requests the API to generate a URL which is then passed to you.
Whatever you're experiencing, it's highly likely not caused by django-minio-backend nor Django.
Maybe a webserver proxying minio?

Regarding your side question: No, not that I know of. You could probably roll your own solution for that but if you need constant access to a certain resource then maybe consider storing it in a public bucket if that's an option. URLs generated towards public buckets do not expire.

j2l commented

Thank you @theriverman