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

Add a file size limit to etag SHA calculations, fallback to "Last modified" when above this limit. #800

Open
samuelclarkemindera opened this issue Mar 8, 2024 · 0 comments

Comments

@samuelclarkemindera
Copy link

Description

  • Define a file size limit
  • Any file above this does not use the etag header
  • It will instead fallback to Last-Modified

Why

When downloading a large file (in my case 3 gig) the page seems to stall for a few minutes before the download begins.
This is due to the time it takes the etag SHA hash to be calculated with larger file sizes.

As a user this felt like something had silently errored.

Alternatives

  • Implementing a faster hashing algorithm (The current crypto/node solution seems fairly quick as is, and requires no external lib)
  • A different method of making the etag
  • Do nothing but remember to use the --no-etag flag (good for those in the know, but bad for random folk who just want a quick file serving solution)
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

No branches or pull requests

1 participant