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

Include the git blob id of the dir-index bundle in the ETag #6465

Closed
wants to merge 2 commits into from
Closed

Include the git blob id of the dir-index bundle in the ETag #6465

wants to merge 2 commits into from

Conversation

mib-kd743naq
Copy link
Contributor

While the content of raw files retrieved via the gateway should never
change, the look and feel of the directory index can and will change
between versions of go-ipfs.

Incorporate the hash of assets/bindata.go into the ETag when appropriate

License: MIT
Signed-off-by: Mib Kd743naq mib.kd743naq@gmail.com

While the content of raw files retrieved via the gateway should never
change, the look and feel of the directory index can and will change
between versions of go-ipfs.

Incorporate the hash of assets/bindata.go into the ETag when appropriate

License: MIT
Signed-off-by: Mib Kd743naq <mib.kd743naq@gmail.com>
@mib-kd743naq
Copy link
Contributor Author

Forgot to add a visual of what this does.

Before:

~$ curl -I 127.0.0.1:8080/ipfs/QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv
HTTP/1.1 200 OK
...
Etag: "QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv"

After:

~$ curl -I 127.0.0.1:8080/ipfs/QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv
HTTP/1.1 200 OK
...
Etag: "DirIndex-ad00a51de6a0a134329b35f56612d3adfb3972d9_CID-QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv"

License: MIT
Signed-off-by: Mib Kd743naq <mib.kd743naq@gmail.com>
Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to avoid relying on someone running the makefile. IIRC, even our binary distribution system manually builds with go build.

What if we either:

  1. Compute this on init (not that expensive).
  2. Add a go generate rule to assets/assets.go (preferred).

@mib-kd743naq
Copy link
Contributor Author

mib-kd743naq commented Jun 27, 2019

even our binary distribution system manually builds with go build.

Whoa! I didn't know this :) The README implies make is the one and only way. I like option 2 as well, will close the PR for now, will reopen when I have a chance to redo.

@Stebalien
Copy link
Member

Well, make is the correct way but I think this is a case of "we know better so we're going to ignore our own best practice".

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

Successfully merging this pull request may close these issues.

2 participants