This repository has been archived by the owner on Jun 25, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 194
Asset Etag is useless and invalid #274
Comments
Hey @AtomicNibble 👋, Thanks for reporting this. This seems only to happen in development mode due to a |
I'm moving this one to the |
Thanks for investigating, does that mean the ETag will change after every deploy tho? |
That's a good question. I think you're right. Here is what I did to prove it:
Notice how Etag changes without any modification to the file. I think Packr is using the compilation time as the last modification time of the file. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The ETag sent back for assets (js,img,..) changes for every response making it useless.
https://github.com/gobuffalo/buffalo/blob/0ffd608c63439be1fc033ad7e48430528c96d2bc/route_mappings.go#L111-L115
This is because packd just returns the time you opened the file.
https://github.com/gobuffalo/packd/blob/128b5da43f114d0f9af8b4bba549b02e3496dfa8/file.go#L115
The ETag is also of invalid format and should be quoted as per RFC https://tools.ietf.org/html/rfc7232#section-2.3
Suggest the ETag is just removed as the info to make a sensible ETag is not avaliable and a very long max-age is already sent back.
The text was updated successfully, but these errors were encountered: