Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use HTTP caching #61

Closed
karpetrosyan opened this issue Dec 7, 2023 · 3 comments · Fixed by #62
Closed

Use HTTP caching #61

karpetrosyan opened this issue Dec 7, 2023 · 3 comments · Fixed by #62
Labels
enhancement New feature or request

Comments

@karpetrosyan
Copy link
Contributor

karpetrosyan commented Dec 7, 2023

Hi! First, thanks for this amazing package.

I'm wondering if you can use Hishel to reduce network traffic and possibly save some rate limits.
Users will be able to save time on responses that support caching (almost every github response).

You could enable in-memory caching at the library level and provide an API to the hishel so users can configure caching and possibly store responses in persistent storage so they can reuse cached responses across multiple executions.

There is also a useful example in the documentation that shows how effective caching can be when working with the github APIs.

If you decide to add this feature, I will gladly submit a pull request!

@yanyongyu yanyongyu added the enhancement New feature or request label Dec 7, 2023
@yanyongyu
Copy link
Owner

This feature seems to be very useful. githubkit previously only considered caching tokens (but still has some problems #44) and ignored api requests. Maybe we could cache both request results and tokens and provide an cache option when creating the GitHub instance.

@karpetrosyan
Copy link
Contributor Author

karpetrosyan commented Dec 7, 2023

As far as I can tell, we can use both caches and they should not conflict.

Is GitHub the only entry point that should support caching, or are there others?

@yanyongyu
Copy link
Owner

The token cache is used in the auth strategy, and the strategy can read configs from the github instance. so, github could be the only entry point and auth strategy could also get the storage provider from it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants