-
-
Notifications
You must be signed in to change notification settings - Fork 120
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
feat: Add mtime
as optional ETag algorithm in file backend alongside default md5
#613
Conversation
Hi @ciscorn Awesome optimisation! |
bbf6a72
to
da7aff6
Compare
@fenos Thanks! |
Awesome job @ciscorn In a major version we could consider switching to this as default |
mtime
as optional ETag algorithm in file backend alongside default md5
Awesome job @ciscorn 🎉 |
🎉 This PR is included in version 1.17.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
What kind of change does this PR introduce?
Fix #612
What is the current behavior?
#612
In the file backend, ETags are generated by calculating the MD5 hash of the entire file contents, which can take several seconds or even more than 10 seconds for larger files. This becomes particularly problematic when utilizing Range requests.
What is the new behavior?
The ETag in the file backend is now generated using only a file's modification time (
mtime
) andsize
. I believe this is sufficient as it follows the same approach used by Nginx (and moreover, the file backend is primarily used in local development).