django-storages
django-storages copied to clipboard
Make it easy to customise expiration for cloudfront
Fix #1222
Hi thanks for the PR.
Instead of this solution how about one where expire
can be any of int|datetime|timedelta
? Would that solve your problem?
Hi. That doesn't help me in any way.
expiration = datetime.utcnow() + timedelta(seconds=expire)
If we're talking about this expression, I have a problem with the part datetime.utcnow()
not in timedelta(seconds=expire)
.
My goal is for links to be generated at discrete time intervals. Like: 1:00 -> 1:30 1:05 -> 1:30 1:15 -> 1:45 1:29 -> 1:45 1:30 -> 2:00 In this case, my link is valid at least 15 minutes. Maximum validity is 30 min. Now it works like 1:00 -> 1:30 1:01 -> 1:31 And it doesn't give any chance for the cache to work.
My change basically makes it easier to make changes. But doesn't make any changes to the result of the work.
Yes but if you could pass in expire=some_datetime
I think that would solve your problem?