Replies: 2 comments 4 replies
-
What I understand about yfinance.cache:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My knowledge of caching is very high-level and I'd like to better understand how it appears to be saving so much time in my routine requests for hour/day/week/month S&P data. As suggested in the docs, I'm using a CachedLimiterSession:
This job runs every 10 minutes during market hours. On first-run (after a fresh deploy), the above code takes roughly 8 minutes. Subsequent runs however, take only 30 seconds! How is this possible given I need to pull 500 stocks across 4 time intervals (i.e 2000 requests) with a 6 request per second rate limit? Assuming the historical data is cached, the current hour/day/week/month close data (i.e. current price) is always in flux, so isn't a minimum of 2000 requests still needed every time? How does caching achieve such dramatic time savings in my scenario? Thank you kindly for your insight.
Beta Was this translation helpful? Give feedback.
All reactions