octokit / octokit.net

A GitHub API client library for .NET
https://octokitnet.readthedocs.io/en/latest/
MIT License
2.69k stars 1.08k forks source link

a better caching experience for Octokit #530

Closed shiftkey closed 2 years ago

shiftkey commented 10 years ago

After discussions in #369 about WinInet I'm leaning towards a different approach for a couple of reasons:

Tavis.PrivateCache has been proposed as a implementation of this, so I'm leaning towards one of two options around this:

Make Tavis.PrivateCache an development dependency, and bake it in

Pros:

Cons:

Pros:

Cons:

The work required is probably about the same, but I'm leaning toward option 1 because it'll be simpler for users of the library.

cc @paulcbetts @darrelmiller @niik

haacked commented 10 years ago

:thumbsup: to option 1

darrelmiller commented 10 years ago

I am happy to help in any way I can. My recent blog post on the Vary header (http://bizcoder.com/the-insanity-of-the-vary-header) was my first step to fixing the current vary implementation and the next major task is do a persistent storage mechanism. The current implementation is only an in-memory store.

shiftkey commented 10 years ago

The current implementation is only an in-memory store.

I think that's a "good enough" option for now for our use case, but perhaps down the track someone might want to implement their own backing store for it (imagine a service who wants to push that memory usage out of process, for example).

nigel-sampson commented 9 years ago

I created a naive implementation of the latter solution by creating a custom http client https://github.com/nigel-sampson/octokit.caching

anaisbetts commented 9 years ago

shiftkey commented 9 years ago

anaisbetts commented 9 years ago

Hubot img me Jonny Lee Miller 2015

darrelmiller commented 9 years ago

Oh, where oh where are the other 48 hours I need in a day.

shiftkey commented 9 years ago

Status update: I'm ranting and raving over in #781 about first class support for HttpClient/HttpMessageHandler - once I get that right I think this will be trivial to add - and I already have crazy ideas in my head about how to do it...

darrelmiller commented 9 years ago

Yesterday I did a major update to my HTTPCache to fix the problems with the way the vary header is handled. I also renamed it because how it can handle being a shared cache too! This also caused a change to the storage interface. Next step is to produce a persistent storage mechanism.

shiftkey commented 9 years ago

@darrelmiller so if I head down the road towards something like this does that make your life easier or harder?

darrelmiller commented 9 years ago

@shiftkey Much easier. Adding my cache would look pretty much exactly like you showed it in the example.

github-actions[bot] commented 2 years ago

👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!