-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
max-downloads seems not to delete the file #470
Comments
hello @fnpanic , to delete a file you have two options:
the fact that navigating the browser history back trigger the file download is probably due to caching, either in nginx or in the browser. @stefanbenten we might want to add headers to prevent caching to solve this, what do you think? |
Yeah, seems like we need to add no-cache directives to the actual content being served. Additionally, the purging does only delete the files after the set retention time, not if the |
yes, but indeed I'm quite positive about this behaviour: it is
as consequence of my opinion above, I would say we must consider thoroughly befor adding extra complexity that might not be necessary.
has this behaviour really an impact on the two achievements?
what do you think, @stefanbenten ? |
To me its more of the question whats the point in keeping the file on the service/server if it can not be downloaded anymore. Either its missing a feature of something like an override for the owner or to change the value upwards? I do agree that likely fixing the documentation is sufficient, but i fully understand the confusion that users might run into. Lets fix the caching in the browser first, then we can discuss the second part? |
good point, but I was more on decoupling the deletion part from the expiration part. not easy to implement without keeping a state of the files past max-downloads and having a goroutine regularly purging them. the problem is how to implement the state to persist across restart of the service (indeed there is already: metadata file) and/or not having to scan every file uploaded to purge the expired ones asynchronously. so maybe yes, in the end the best solution is to delete those files as soon as they receive a GET request and we know they are expired: beware that even in this case if there are no "exceeding" GET requests they won't be purged anyway. but if this is the case then why not relying only on the already existing purging mechanism? |
to summarise I see to different scenarios:
the specific scenario the discussion started from was from the users point of view: cache header missing that prevented the settings about blocking downloads to be fulfilled |
I agree, the header should fix this scenario! |
In order to prevent viewing content, which max-download rate has been reached, we need to ensure the data is not stored locally in a browser cache. To achieve this, we set the Cache-Control Setting to "no-store" according to: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control fixes #470
In order to prevent viewing content, which max-download rate has been reached, we need to ensure the data is not stored locally in a browser cache. To achieve this, we set the Cache-Control Setting to "no-store" according to: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control fixes #470
Hi,
Great tool! Thank you very much.
i am using max downloads 1 header on the files. It works for non images perfect. Then i noticed that the image is embedded in the page and displayed but the download button is still there. When i click it, it says 404 which is desired. When i press back in the browser it downloads the file as often as i want.
I am running transfer.sh behind a nginx under the patch /transfer with the latest docker. this works great.
Why is the file not removed after download?
Thanks in advance.
The text was updated successfully, but these errors were encountered: