Skip to content

Add support for If-Modified-Since conditional requests #374

Open
@Hixie

Description

@Hixie

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 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy