-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
fileserver: Read Etags from precomputed files #6222
Conversation
01a0959
to
77a845f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the great enhancement! This looks pretty good but I just have a few comments.
77a845f
to
2bd54ef
Compare
Thanks for taking a look at this Matt. All the feedback discussions should now be resolved. |
2bd54ef
to
6fc1713
Compare
Awesome, thanks for working on this! |
Nice! I wish there were docs for this. I stumbled upon this while looking in the source code to check why my custom etag headers weren't used to serve 304s. |
|
Docs are being updated with the new features shortly :) |
Thanks, right now this is quite easy to misuse. I.e. the etag files must not have newlines and must include quotes https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-None-Match is specific for that as well. Here's a short cmd to generate them in the correct format:
I'm wondering whether this should create a warning in the logs or Caddy can just do the "right thing" and trim and quote the value. |
If the etag is weak, though, the quotes won't be around the whole thing. We could probably trim newlines if that's a common occurrence, but it's not something I've encountered in my (limited) experience. |
As long as it ends up in the docs I'm happy 🙂 It's easy to waste time with this digging into the source code of |
I'd welcome a PR at least for the newline patch! |
Initial pass at closing #5734