You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm interested in implementing this feature. I'm curious if you have opinions about how it should be implemented.
From an API perspective what seems like the simplest option is to add a field to some of the model classes (e.g. Issue) that exposes the Last-Modified header of the request that obtained the data (e.g. Issue.httpLastModified), and have some of the methods that call into the GitHub API take an optional named argument (e.g. ifModifiedSince) that is used to configure the request, and someone would pass in the httpLastModified value from the last time they did the request as the value of the ifModifiedSince parameter.
However, it's not entirely clear to me what the best implementation strategy is within the package itself. The current architecture doesn't have any way to pass out-of-band data like HTTP headers.
Alternatively we could do something similar to the rate limit headers, and store the last request's Last-Modified header on the GitHub object. That seems easy to implement, if not quite as clean from an API perspective.
The text was updated successfully, but these errors were encountered:
GitHub supports a mechanism by which if nothing has changed since the last time a request was made, it will save you the rate limits: https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#conditional-requests
I'm interested in implementing this feature. I'm curious if you have opinions about how it should be implemented.
From an API perspective what seems like the simplest option is to add a field to some of the model classes (e.g.
Issue
) that exposes theLast-Modified
header of the request that obtained the data (e.g.Issue.httpLastModified
), and have some of the methods that call into the GitHub API take an optional named argument (e.g.ifModifiedSince
) that is used to configure the request, and someone would pass in thehttpLastModified
value from the last time they did the request as the value of theifModifiedSince
parameter.However, it's not entirely clear to me what the best implementation strategy is within the package itself. The current architecture doesn't have any way to pass out-of-band data like HTTP headers.
Alternatively we could do something similar to the rate limit headers, and store the last request's
Last-Modified
header on theGitHub
object. That seems easy to implement, if not quite as clean from an API perspective.The text was updated successfully, but these errors were encountered: