Make time expiry configurable
Closed this issue · 4 comments
The time expiry feature should be configurable
- Public files shouldn't expire
- Private files should have a time expiry period that is pulled from site_config
@agritheory, the files are fetched on-demand, and by default, the generated signed URL expires in 2 minutes. Is that what we're trying to adjust?
Looking at the botocore docs, it seems like we can give it an arbitrarily high value to avoid URL expiry.
@Alchez Yes, a client in an area with poor connectivity and regularly handling large files may opt for a longer timeout.
For files that are public, we want to bypass the time expiry completely. I believe the right endpoint for this is download_file_obj
, not generate_presigned_url
.
@agritheory, I tried out both download_fileobj
and download_file
and they don't give us URLs to redirect to. Instead, we just receive file data. The problem with that is we'll need to store it locally on the filesystem to be able to show the user the file.
Do we keep downloading a file everytime someone tries to fetch it? Should we store a reference to the local file in the File
document once it's downloaded and re-use that? What do you think?
Do we keep downloading a file everytime someone tries to fetch it?
No. The file URL should be set with this function and be streamed directly to the browser when provided with the URL.
Should we store a reference to the local file in the File document once it's downloaded and re-use that?
There server only provides a redirect URL, there is no downloading.
No public files should be stored locally.