Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it easy to customise expiration for cloudfront #1226

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Mogost
Copy link

@Mogost Mogost commented Mar 28, 2023

Fix #1222

@jschneier
Copy link
Owner

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?

@Mogost
Copy link
Author

Mogost commented Sep 11, 2023

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.

@jschneier
Copy link
Owner

Yes but if you could pass in expire=some_datetime I think that would solve your problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Customisable expiration for s3 backend
2 participants