I’m trying to implement ETag usage, but I was unable to find information on how to correctly use ETag for paginated responses. For example, I send the following request (assuming that the answer has more than 20 entries):
GitHub response 1 is:
HTTP 200 OK ETag: W/"abcdef" Link: xxxx ...
From the ‘Link’ field I get a request for the next page and send it:
GitHub response 2 is:
HTTP 200 OK ETag: W/"123456" Link: xxxx ...
… and so on.
Now I want to use ETag to get the data again, and send the following request:
GET user/repos?per_page=20 If-None-Match: "abcdef"
The GitHub response is:
HTTP 304 Not Modified
My question is – how I should interpret the GitHub answer:
- Only the first page has not been modified, and I should make calls for other pages too (with their ETags)? But there is no ‘Link’ header in the response…
- The entire data array has not been modified including all subsequent pages, so no additional requests are required?