Skip to content

Commit 2e26546

Browse files
authored
docs: Update HTTP cache references to RFC 9111 compliant implementation (#3608)
1 parent a2e5acc commit 2e26546

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,15 +263,18 @@ rate limit, as well as help speed up your application. `go-github` does not
263263
handle conditional requests directly, but is instead designed to work with a
264264
caching `http.Transport`.
265265

266-
Typically, an [RFC 7234](https://datatracker.ietf.org/doc/html/rfc7234)
267-
compliant HTTP cache such as [gregjones/httpcache](https://github.com/gregjones/httpcache)
266+
Typically, an [RFC 9111](https://datatracker.ietf.org/doc/html/rfc9111)
267+
compliant HTTP cache such as [bartventer/httpcache](https://github.com/bartventer/httpcache)
268268
is recommended, ex:
269269

270270
```go
271-
import "github.com/gregjones/httpcache"
271+
import (
272+
"github.com/bartventer/httpcache"
273+
_ "github.com/bartventer/httpcache/store/memcache" // Register the in-memory backend
274+
)
272275

273276
client := github.NewClient(
274-
httpcache.NewMemoryCacheTransport().Client()
277+
httpcache.NewClient("memcache://"),
275278
).WithAuthToken(os.Getenv("GITHUB_TOKEN"))
276279
```
277280

github/doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ rate limit, as well as help speed up your application. go-github does not
144144
handle conditional requests directly, but is instead designed to work with a
145145
caching [http.Transport].
146146
147-
Typically, an RFC 7234 compliant HTTP cache such as https://github.com/gregjones/httpcache
147+
Typically, an RFC 9111 compliant HTTP cache such as https://github.com/bartventer/httpcache
148148
is recommended. Alternatively, the https://github.com/bored-engineer/github-conditional-http-transport
149149
package relies on (undocumented) GitHub specific cache logic and is
150150
recommended when making requests using short-lived credentials such as a

github/github.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ func (c *Client) bareDo(ctx context.Context, caller *http.Client, req *http.Requ
895895
}
896896

897897
// Don't update the rate limits if this was a cached response.
898-
// X-From-Cache is set by https://github.com/gregjones/httpcache
898+
// X-From-Cache is set by https://github.com/bartventer/httpcache
899899
if response.Header.Get("X-From-Cache") == "" {
900900
c.rateMu.Lock()
901901
c.rateLimits[rateLimitCategory] = response.Rate

0 commit comments

Comments
 (0)