← Back to Help Center

πŸ’Ύ Historical Data Cache

IndexedDB-based caching for historical stock data β€” faster scans, fewer API calls.

πŸ“¦ INDEXEDDB ⚑ DELTA FETCH πŸ”„ AUTO REFRESH
Contents: What it does Β· How it works Β· Storage details Β· Cache Settings Β· FAQ

🎯 What it does

TradePro stores historical OHLCV price data in your browser's IndexedDB database. The first time you run the Strategy Scanner or Pattern Recognition on a set of tickers, it fetches up to 5 years of daily data from Yahoo Finance via the Cloudflare Worker. That data is saved locally β€” the next scan loads directly from cache, skipping the API call entirely.

Result: A strategy scan that previously took 2–3 minutes (800 tickers Γ— API calls) runs in seconds after the cache is warm. Only tickers with new trading days since your last scan need an update.

βš™οΈ How it works

1. Cache check

Before every API call, historical-data-service.js checks whether valid cached data already exists for the ticker and date range. "Valid" means the cache covers the requested range minus a 1-day tolerance (to handle weekends and holidays).

2. Delta fetch

If the cache exists but is missing recent days, only the missing period is fetched. For example, if cache covers up to last Friday and today is Tuesday, only Mon–Tue is fetched and merged.

3. Full refresh

Once a month (configurable), the full dataset for a ticker is re-fetched to pick up split-adjusted prices. Yahoo Finance already adjusts for splits via adjclose, but a monthly refresh ensures the entire series stays accurate.

4. Progress feedback

The strategy scanner progress bar shows live cache stats: how many tickers were served from cache vs. freshly fetched. Events cache-hit and cache-write are dispatched on window for real-time UI updates.

πŸ“¦ Storage details

PropertyValue
Database namestock-cache
Version1
Store: priceskeyPath [ticker, date] β€” one row per ticker/day
Store: metakeyPath ticker β€” last fetched timestamp, cache build date
Libraryidb@8 (Jake Archibald's IndexedDB wrapper, ~1 KB)
Typical size800 tickers Γ— 5 years β‰ˆ ~80–120 MB (fits comfortably in IndexedDB)
Browser supportAll modern browsers (Chrome, Firefox, Safari, Edge)
Data is stored only in your browser β€” nothing is sent to any server. Clearing browser storage or using incognito mode will wipe the cache.

πŸ› οΈ Cache Settings

In the main app (index.html), open βš™οΈ Settings β†’ API Configuration and scroll to the "πŸ’Ύ Historical Data Cache" section. From there you can:

Clearing the cache does not affect your watchlists, saved strategies, or API keys. Only historical price data is removed.

❓ FAQ

Why does my first scan still take a long time?

The first scan always fetches all data fresh β€” there is nothing in cache yet. Subsequent scans benefit from the cache. Consider running a full scan overnight to warm the cache.

Data looks stale β€” what do I do?

Open Settings β†’ Historical Data Cache and click Clear All Cache. The next scan will fetch everything fresh. This is also done automatically once a month per ticker.

The VWAP card is missing the last few days

This was a known bug (fixed in commit bf31d07). The cache now uses a 1-day tolerance and reads up to today's date. If you still see stale data, clear the cache for the affected ticker.

Does the cache work across different pages?

Yes β€” Strategy Scanner, Market Pattern Recognition, and Universal Market Scanner all share the same IndexedDB database. Data fetched on one page is available on all others.

Will clearing browser cookies/history affect the cache?

Cookies and history are separate from IndexedDB. However, clearing "all site data" or using browser privacy tools that wipe storage will remove the cache.

Last updated: 2026-03-21 Β· Help Center