Closed bbelderbos closed 1 week ago
I love it. How long should I set the expiration for, a week?
That works for me, do we want a cache refresh flag (basically delete the cache file)
That can be a follow up because addition of bites is not that frequent anyway.
I didn't see your last comment until afterward. But what I ended up doing was setting the cache to expire after 30 days, but added a --clear-cache
flag for the user if needed. I think that is a good in-between. a3b391d
That's perfect, thanks!
The new bite api endpoint is pretty static, we don't even add new bites every week and titles don't change often.
So let's add caching and with requests this is very easy: https://pybitesplatform.com/tips/caching-api-calls
This will make the sub command respond instantly leveraging a local sqlite db, something the user does not even notices.
pybites-search is so fast using this same technique: https://github.com/PyBites-Open-Source/search/blob/main/src/pybites_search/base.py#L26
@rhelmstedter what do you think?