Skip to content

Instantly share code, notes, and snippets.

@ingydotnet
Created April 17, 2014 04:29
Show Gist options
  • Select an option

  • Save ingydotnet/10952885 to your computer and use it in GitHub Desktop.

Select an option

Save ingydotnet/10952885 to your computer and use it in GitHub Desktop.
ETag not Changing
> curl --silent https://api.github.com/repos/aocole/skill-shot-list --dump-header head > out; echo; grep '^ETag' head; sha1sum out
ETag: "7b3a97ee2c14ca372c126dcc3773db1e"
816ebdfad5e3a0e5155f65ca8d44aa4dbbcdd79a out
> git hub unstar aocole/skill-shot-list
'aocole/skill-shot-list' unstarred
> curl --silent https://api.github.com/repos/aocole/skill-shot-list --dump-header head > out; echo; grep '^ETag' head; sha1sum out
ETag: "7b3a97ee2c14ca372c126dcc3773db1e"
ea2aab4fd641e6a6ffe37ecf4ab50b1737497fc5 out
>
@ingydotnet

Copy link
Copy Markdown
Author

Here is another example of GitHub API serving different API content with the same ETag.

I've reported this bug 3 times, and every time it gets a bandaid fix for the exact problem I report, but this is a major systemic problem.

Note: I found this error 5 minutes after the last time GitHub said the issue was resolved, but I didn't report it then because it was so disheartening to wait a month for the fix only to realize that it didn't work (except for my exact reported replication strategy.

GitHub needs to test this with every endpoint and parameter combination, etc.

It is my personal opinion that the API content is too rich to be able to detect content change in a resource efficient manner, thus making ETag caching a lose/lose proposition. I would love to be proven wrong, but it is a failure to tell people that that ETag is a good way to conserve rate limit, when in fact it only makes API clients give bad information. There is no shame in scrapping the ETag feature, if it can't be made to work agreeably. The API is otherwise one of the best I've used.

I will pull ETag support from the git-hub client ( https://github.com/ingydotnet/git-hub#readme ) for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment