hedyhli / starcli

:sparkles: Browse trending GitHub projects from your command line
https://pypi.org/project/starcli/
MIT License
550 stars 50 forks source link

Caching request responses to prevent hitting rate limits #61

Closed hedyhli closed 3 years ago

hedyhli commented 4 years ago

Description

GitHub API has rate limits, and sometimes when using starcli it takes up to 10+ secs to see the output, we should cache the responses based on options (like topic/stars/dates etc) somewhere so that when the user uses the same options again within say 1 minute, it can just fetch the cached info instead of sending the request again

Why is it necessary? (or how would it make it better)

This improves the execution speed/performance

how do you think should it be implemented? (If possible)

Every time search is called we cache the response together with the options used, so when the same options are used again we output the cached data instead

shivam212 commented 4 years ago

Caching could be done, but how should we implement it, would simple caching in form of a text file be ok, or would we want something like redis?

hedyhli commented 4 years ago

I think a html/json/xml file will be ok, we should implement caching after #68 is implemented because this will probably take longer to work out what to do

grplyler commented 3 years ago

Hi there! I would like to contribute for Hacktoberfest 2020. Is this issue still up for grabs?

hedyhli commented 3 years ago

Yes it's up for grabs, thanks for your interest

krishnan2098 commented 3 years ago

If it is still up for grabs, I'd like to work on it.

AkashD-Developer commented 3 years ago

Hey, @hedythedev I have added a pull request for this issue. Please have a look. Sorry that I didn't confirm it here first but it seemed that this issue was not solved even after few requests for grabs so thought it will be good to directly create a pull request.